版本更新
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
package com.openhis.web.inpatientmanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionSearchParam;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionUpDto;
|
||||
|
||||
/**
|
||||
* 住院登记 应用实现
|
||||
*
|
||||
* @author liuhr
|
||||
* @since 2025/04/07
|
||||
*/
|
||||
public interface IAdmissionAppService {
|
||||
|
||||
/**
|
||||
* 病获取住院信息初期数据列表
|
||||
*
|
||||
* @return 住院信息初期数据列表
|
||||
*/
|
||||
R<?> getAdmissionInfoInit();
|
||||
|
||||
/**
|
||||
* 获取住院信息 分页显示
|
||||
*
|
||||
* @param admissionSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院信息
|
||||
*/
|
||||
R<?> getAdmissionInfoPage(AdmissionSearchParam admissionSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 住院无档登记
|
||||
*
|
||||
* @param admissionUpDto 住院登记信息
|
||||
*/
|
||||
R<?> addAdmissionInfo(AdmissionUpDto admissionUpDto);
|
||||
|
||||
/**
|
||||
* 登记
|
||||
*
|
||||
* @param admissionUpDto 住院登记信息
|
||||
*/
|
||||
R<?> editAdmissionInfo(AdmissionUpDto admissionUpDto);
|
||||
|
||||
/**
|
||||
* 住院登记详细查询
|
||||
*
|
||||
* @param id 查询条件
|
||||
* @return 住院登记详细查询结果
|
||||
*/
|
||||
R<?> getAdmissionOne(@RequestParam Long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.openhis.web.inpatientmanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.dto.DepositSearchParam;
|
||||
import com.openhis.yb.dto.PaymentDto;
|
||||
|
||||
/**
|
||||
* 住院登记 应用实现
|
||||
*
|
||||
* @author gyy
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
public interface IDepositAppService {
|
||||
|
||||
/**
|
||||
* 病获取预交金信息初期数据列表
|
||||
*
|
||||
* @return 预交金信息初期数据列表
|
||||
*/
|
||||
R<?> getDepositInfoInit();
|
||||
|
||||
/**
|
||||
* 获取预交金信息 分页显示
|
||||
*
|
||||
* @param depositSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院信息
|
||||
*/
|
||||
R<?> getDepositInfoPage(DepositSearchParam depositSearchParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 付款
|
||||
*
|
||||
* @param paymentDto 入参
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> savePayment(PaymentDto paymentDto);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.openhis.web.inpatientmanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingEmrTemplateDto;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingRecordDto;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingSearchParam;
|
||||
|
||||
/**
|
||||
* 护理记录单 应用实现
|
||||
*
|
||||
* @author gyy
|
||||
* @since 2025/05/30
|
||||
*/
|
||||
public interface INursingRecordAppService {
|
||||
|
||||
/**
|
||||
* 获取住院患者信息 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者信息
|
||||
*/
|
||||
R<?> getPatientInfoPage(NursingSearchParam nursingSearchParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 获取患者护理记录单信息 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者护理记录单信息
|
||||
*/
|
||||
R<?> getNursingPatientPage(NursingSearchParam nursingSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 保存护理记录单
|
||||
*
|
||||
* @param nursingRecordDto 入参
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> saveRecord(NursingRecordDto nursingRecordDto);
|
||||
|
||||
/**
|
||||
* 编辑护理记录单
|
||||
*
|
||||
* @param nursingRecordDto 入参
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> updateRecord(NursingRecordDto nursingRecordDto);
|
||||
|
||||
/**
|
||||
* 删除护理记录单
|
||||
*
|
||||
* @param recordList 记录单List
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> delRecord(List<NursingRecordDto> recordList);
|
||||
|
||||
/**
|
||||
* 获取电子病历模板列表 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 电子病历模板信息
|
||||
*/
|
||||
R<?> getEmrTemplate(NursingSearchParam nursingSearchParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 保存病历模板
|
||||
*
|
||||
* @param emrTemplateDto 病历模板信息
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> saveEmrTemplate(NursingEmrTemplateDto emrTemplateDto);
|
||||
|
||||
/**
|
||||
* 删除病历模板
|
||||
*
|
||||
* @param idList 模板id
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> deleteEmrTemplate(List<Long> idList);
|
||||
|
||||
/**
|
||||
* 编辑病历模板
|
||||
*
|
||||
* @param emrTemplateDto 病历模板信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> updateEmrTemplate(NursingEmrTemplateDto emrTemplateDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.openhis.web.inpatientmanage.appservice;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.OrgMetadata;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeSearchParam;
|
||||
|
||||
/**
|
||||
* 患者首页 应用实现
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
public interface IPatientHomeAppService {
|
||||
|
||||
/**
|
||||
* 获取患者首页信息初期数据列表
|
||||
*
|
||||
* @return 患者首页初期数据列表
|
||||
*/
|
||||
R<?> getPatientInfoInit(PatientHomeSearchParam patientHomeSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 获取空床信息
|
||||
*
|
||||
* @return 空床信息
|
||||
*/
|
||||
R<?> getEmptyBed(Long organizationId);
|
||||
|
||||
/**
|
||||
* 转床保存
|
||||
*
|
||||
* @return 转床结果
|
||||
*/
|
||||
R<?> saveBedTransfer(Long encounterLocationId, Long encounterId, Long oldLocationId, Long newLocationId);
|
||||
|
||||
/**
|
||||
* 获取科室信息
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
List<OrgMetadata> getCaty();
|
||||
|
||||
/**
|
||||
* 转科保存
|
||||
*
|
||||
* @return 转科结果
|
||||
*/
|
||||
R<?> saveDepartmentTransfer(Long encounterLocationId, Long patientId, Long encounterId, Long organizationId,
|
||||
Date DepartmentTransferYmd);
|
||||
|
||||
/**
|
||||
* 出院
|
||||
*
|
||||
* @return 出院
|
||||
*/
|
||||
R<?> saveDischargeHospital(Long encounterLocationId, Long patientId, Long encounterId, Long locationId,
|
||||
Date DischargeHospitalYmd);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.openhis.web.inpatientmanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.dto.VitalSignsDeleteDto;
|
||||
import com.openhis.web.inpatientmanage.dto.VitalSignsSaveDto;
|
||||
import com.openhis.web.inpatientmanage.dto.VitalSignsSearchParam;
|
||||
|
||||
/**
|
||||
* 三测单 应用实现
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
public interface IVitalSignsAppService {
|
||||
|
||||
/**
|
||||
* 获取患者体温单信息数据列表
|
||||
*
|
||||
* @return 获取患者体温单信息数据列表
|
||||
*/
|
||||
R<?> getVitalSignsInfo(VitalSignsSearchParam vitalSignsSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 体温单记录保存
|
||||
*
|
||||
* @return 体温单记录保存结果
|
||||
*/
|
||||
R<?> saveVitalSigns(VitalSignsSaveDto vitalSignsSaveDto);
|
||||
|
||||
/**
|
||||
* 体温单检索
|
||||
*
|
||||
* @return 体温单检索结果
|
||||
*/
|
||||
R<?> searchVitalSigns(String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 体温单记录删除
|
||||
*
|
||||
* @return 体温单记录删除结果
|
||||
*/
|
||||
R<?> deleteVitalSigns(List<VitalSignsDeleteDto> vitalSignsDeleteDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
package com.openhis.web.inpatientmanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
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.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Account;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.administration.domain.EncounterLocation;
|
||||
import com.openhis.administration.service.IAccountService;
|
||||
import com.openhis.administration.service.IEncounterLocationService;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
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.web.inpatientmanage.appservice.IAdmissionAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionDto;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionInitPageDto;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionSearchParam;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionUpDto;
|
||||
import com.openhis.web.inpatientmanage.mapper.AdmissionMapper;
|
||||
import com.openhis.web.patientmanage.appservice.IPatientInformationService;
|
||||
import com.openhis.web.patientmanage.dto.PatientInformationDto;
|
||||
|
||||
/**
|
||||
* 住院管理 实现类
|
||||
*
|
||||
* @author liuhr
|
||||
* @since 2025/04/07
|
||||
*/
|
||||
@Service
|
||||
public class AdmissionAppServiceImpl implements IAdmissionAppService {
|
||||
|
||||
@Resource
|
||||
private AdmissionMapper admissionMapper;
|
||||
|
||||
@Resource
|
||||
private IPatientInformationService patientInformationService;
|
||||
|
||||
@Resource
|
||||
private IEncounterService encounterService;
|
||||
|
||||
@Resource
|
||||
private IEncounterLocationService encounterLocationService;
|
||||
|
||||
@Resource
|
||||
private IAccountService accountService;
|
||||
|
||||
/**
|
||||
* 病获取住院信息初期数据列表
|
||||
*
|
||||
* @return 住院信息初期数据列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAdmissionInfoInit() {
|
||||
|
||||
AdmissionInitPageDto initDto = new AdmissionInitPageDto();
|
||||
// 入院类型列表
|
||||
List<AdmissionInitPageDto.statusEnumOption> statusEnumOptions1 = Stream.of(AdmissionType.values())
|
||||
.map(status -> new AdmissionInitPageDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setAdmissionTypeList(statusEnumOptions1);
|
||||
|
||||
// 入院方式列表
|
||||
List<AdmissionInitPageDto.statusEnumOption> statusEnumOptions2 = Stream.of(AdmissionMethod.values())
|
||||
.map(status -> new AdmissionInitPageDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setAdmissionMethodList(statusEnumOptions2);
|
||||
|
||||
// 优先级编码列表:患者病情下拉选
|
||||
List<AdmissionInitPageDto.statusEnumOption> statusEnumOptions3 = Stream.of(PriorityLevel.values())
|
||||
.map(status -> new AdmissionInitPageDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setPriorityEnumList(statusEnumOptions3);
|
||||
|
||||
return R.ok(initDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取住院信息 分页显示
|
||||
*
|
||||
* @param admissionSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAdmissionInfoPage(AdmissionSearchParam admissionSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdmissionDto> queryWrapper = HisQueryUtils.buildQueryWrapper(admissionSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
request);
|
||||
|
||||
// 分页查询,查询住院
|
||||
IPage<AdmissionDto> admissionInfoPage = admissionMapper.getPage(new Page<>(pageNo, pageSize),
|
||||
EncounterClass.AMB.getValue(), LocationForm.WARD.getValue(), queryWrapper);
|
||||
|
||||
admissionInfoPage.getRecords().forEach(e -> {
|
||||
// 性别枚举类回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
// e.setAgeString(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
|
||||
});
|
||||
|
||||
// 返回【住院信息列表DTO】分页
|
||||
return R.ok(admissionInfoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院无档登记
|
||||
*
|
||||
* @param admissionUpDto 住院登记信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> addAdmissionInfo(AdmissionUpDto admissionUpDto) {
|
||||
|
||||
// 1.添加病人信息
|
||||
PatientInformationDto patientInformationDto = convertToPatientInformationDto(admissionUpDto);
|
||||
|
||||
R<?> addPatientResult = patientInformationService.addPatient(patientInformationDto);
|
||||
// 检查返回值的状态码
|
||||
boolean insertPatientSuccess = (addPatientResult.getCode() == 200);
|
||||
|
||||
// 2.添加就诊信息,3.添加就诊账户,4.添加就诊病区
|
||||
admissionUpDto.setYbClassEnum(EncounterYbClass.ORDINARY_HOSPITALIZATION.getValue());
|
||||
boolean encounterLocationAndAccountSuccess = handleEncounterLocationAccount(admissionUpDto);
|
||||
|
||||
if (insertPatientSuccess && encounterLocationAndAccountSuccess) {
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"住院无档登记"}));
|
||||
} else {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, null));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 登记
|
||||
*
|
||||
* @param admissionUpDto 住院登记信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> editAdmissionInfo(AdmissionUpDto admissionUpDto) {
|
||||
|
||||
// 1.修改病人信息
|
||||
PatientInformationDto patientInformationDto = convertToPatientInformationDto(admissionUpDto);
|
||||
|
||||
R<?> editPatientResult = patientInformationService.editPatient(patientInformationDto);
|
||||
// 检查返回值的状态码
|
||||
boolean updatePatientSuccess = (editPatientResult.getCode() == 200);
|
||||
|
||||
// 2.修改就诊信息,3.添加就诊账户,4.添加就诊病区
|
||||
boolean encounterLocationAndAccountSuccess = handleEncounterLocationAccount(admissionUpDto);
|
||||
|
||||
if (updatePatientSuccess && encounterLocationAndAccountSuccess) {
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"住院登记"}));
|
||||
} else {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院登记,添加就诊账户和就诊病区
|
||||
*
|
||||
* @param admissionUpDto 住院登记信息
|
||||
* @return 住院登记详细查询结果
|
||||
*/
|
||||
public boolean handleEncounterLocationAccount(AdmissionUpDto admissionUpDto) {
|
||||
|
||||
// 2.修改或者插入就诊信息
|
||||
Encounter encounter = new Encounter();
|
||||
encounter.setId(admissionUpDto.getId()).setPatientId(admissionUpDto.getPatientId())
|
||||
.setStatusEnum(EncounterStatus.IN_PROGRESS.getValue()).setOrganizationId(admissionUpDto.getOrganizationId())
|
||||
.setAdmitSourceCode(admissionUpDto.getAdmitSourceCode()).setInWayCode(admissionUpDto.getInWayCode())
|
||||
.setStartTime(admissionUpDto.getStartTime()).setClassEnum(EncounterClass.IMP.getValue())
|
||||
.setPriorityEnum(admissionUpDto.getPriorityEnum()).setYbClassEnum(admissionUpDto.getYbClassEnum())
|
||||
.setSubjectStatusEnum(EncounterSubjectStatus.PLANNED.getValue());
|
||||
|
||||
boolean encounterSuccess = encounterService.saveOrUpdateEncounter(encounter);
|
||||
|
||||
// 3.添加就诊账户account
|
||||
Account account = new Account();
|
||||
account.setName(admissionUpDto.getName()).setPatientId(admissionUpDto.getPatientId())
|
||||
.setEncounterId(admissionUpDto.getId())
|
||||
// 账户状态是有效的
|
||||
.setStatusEnum(AccountStatus.ACTIVE.getValue())
|
||||
// 结账状态是可用的
|
||||
.setBillingStatusEnum(AccountBillingStatus.OPEN.getValue());
|
||||
boolean updateAccountSuccess = accountService.saveOrUpdateAccount(account);
|
||||
|
||||
// 4.添加就诊病区location
|
||||
EncounterLocation encounterLocation = new EncounterLocation();
|
||||
encounterLocation.setLocationId(admissionUpDto.getWardLocationId()).setEncounterId(admissionUpDto.getId())
|
||||
.setFormEnum(LocationForm.WARD.getValue()).setStartTime(admissionUpDto.getStartTime())
|
||||
.setStatusEnum(EncounterLocationStatus.ACTIVE.getValue());
|
||||
boolean encounterLocationSuccess = encounterLocationService.saveOrUpdateEncounterLocation(encounterLocation);
|
||||
|
||||
return encounterSuccess && updateAccountSuccess && encounterLocationSuccess;
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院登记详细查询
|
||||
*
|
||||
* @param id 就诊ID
|
||||
* @return 住院登记详细查询结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAdmissionOne(@RequestParam Long id) {
|
||||
|
||||
// 获取租户ID
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// 根据ID查询 住院登记详细
|
||||
AdmissionUpDto admissionUpDto = admissionMapper.getAdmissionOne(EncounterClass.IMP.getValue(),
|
||||
EncounterStatus.DISCHARGED.getValue(), LocationForm.BED.getValue(), LocationForm.WARD.getValue(),
|
||||
ParticipantType.ADMITTER.getCode(), LocationBedStatus.O.getValue(), id, tenantId);
|
||||
|
||||
// 查询患者病情站诊断
|
||||
// List<String> descriptionList = nurseStationPendAdmAppMapper.getDescriptionList(id);
|
||||
// 诊断病情拼接
|
||||
// if (descriptionList != null && !descriptionList.isEmpty()) {
|
||||
// admissionUpDto.setDescriptions(String.join(CommonConstants.Common.COMMA, descriptionList));
|
||||
// }
|
||||
|
||||
return R.ok(admissionUpDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 AdmissionUpDto 的字段值手动设置到 PatientInformationDto 中
|
||||
*
|
||||
* @param admissionUpDto 源对象
|
||||
* @return 目标对象
|
||||
*/
|
||||
public PatientInformationDto convertToPatientInformationDto(AdmissionUpDto admissionUpDto) {
|
||||
return new PatientInformationDto().setId(admissionUpDto.getPatientId()).setName(admissionUpDto.getName())
|
||||
.setGenderEnum(admissionUpDto.getGenderEnum()).setBirthDate(admissionUpDto.getBirthDate())
|
||||
.setMaritalStatusEnum(admissionUpDto.getMaritalStatusEnum()).setPrfsEnum(admissionUpDto.getPrfsEnum())
|
||||
.setPhone(admissionUpDto.getPhone()).setAddress(admissionUpDto.getAddress())
|
||||
.setNationalityCode(admissionUpDto.getNationalityCode()).setIdCard(admissionUpDto.getIdCard())
|
||||
.setPyStr(admissionUpDto.getPyStr()).setWbStr(admissionUpDto.getWbStr())
|
||||
.setWorkCompany(admissionUpDto.getWorkCompany()).setNativePlace(admissionUpDto.getNativePlace())
|
||||
.setCountryCode(admissionUpDto.getCountryCode()).setLinkName(admissionUpDto.getLinkName())
|
||||
.setLinkRelationCode(admissionUpDto.getLinkRelationCode()).setLinkTelcom(admissionUpDto.getLinkTelcom())
|
||||
.setOrganizationId(admissionUpDto.getOrganizationId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
package com.openhis.web.inpatientmanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.yb.dto.PaymentDetailDto;
|
||||
import com.openhis.yb.dto.PaymentDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.core.redis.RedisCache;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Account;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.administration.domain.Invoice;
|
||||
import com.openhis.administration.service.IAccountService;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.administration.service.IInvoiceService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.ybenums.YbPayment;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.domain.PaymentRecDetail;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.service.IPaymentRecDetailService;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.web.inpatientmanage.appservice.IDepositAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.DepositDetailDto;
|
||||
import com.openhis.web.inpatientmanage.dto.DepositInitPageDto;
|
||||
import com.openhis.web.inpatientmanage.dto.DepositSearchParam;
|
||||
import com.openhis.web.inpatientmanage.mapper.DepositMapper;
|
||||
|
||||
/**
|
||||
* 预交金管理 实现类
|
||||
*
|
||||
* @author gyy
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Service
|
||||
public class DepositAppServiceImpl implements IDepositAppService {
|
||||
|
||||
@Resource
|
||||
private DepositMapper depositMapper;
|
||||
|
||||
@Resource
|
||||
private IEncounterService iEncounterService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Resource
|
||||
private IPaymentReconciliationService paymentReconciliationService;
|
||||
|
||||
@Resource
|
||||
private IInvoiceService iInvoiceService;
|
||||
|
||||
@Resource
|
||||
private IPaymentRecDetailService paymentRecDetailService;
|
||||
|
||||
@Resource
|
||||
private IAccountService iAccountService;
|
||||
|
||||
/**
|
||||
* 获取预交金信息初期数据(病人信息)列表
|
||||
*
|
||||
* @return 预交金信息初期数据列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDepositInfoInit() {
|
||||
DepositInitPageDto initDto = new DepositInitPageDto();
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预交金信息 分页显示
|
||||
*
|
||||
* @param depositSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者预交金信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDepositInfoPage(DepositSearchParam depositSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DepositDetailDto> queryWrapper = HisQueryUtils.buildQueryWrapper(depositSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientId)), request);
|
||||
|
||||
// 分页查询,查询患者预交金
|
||||
IPage<DepositDetailDto> depositInfoPage = depositMapper.getPage(new Page<>(pageNo, pageSize),
|
||||
EncounterClass.IMP.getValue(), LocationForm.BED.getValue(), queryWrapper);
|
||||
|
||||
depositInfoPage.getRecords().forEach(e -> {
|
||||
// 性别枚举类回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
e.setAgeString(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
// 支付状态
|
||||
e.setPaymentEnum_enumText(EnumUtils.getInfoByValue(PaymentStatus.class, e.getPaymentEnum()));
|
||||
// 票据状态
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
|
||||
// 返回【患者预交金信息列表DTO】分页
|
||||
return R.ok(depositInfoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 付款
|
||||
*
|
||||
* @param paymentDto 入参
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> savePayment(PaymentDto paymentDto) {
|
||||
// 收款员id
|
||||
Long enterId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
|
||||
// 查询就诊信息(获取就诊ID)
|
||||
Encounter encounter = iEncounterService
|
||||
.getOne(new LambdaQueryWrapper<Encounter>().eq(Encounter::getId, paymentDto.getEncounterId()));
|
||||
|
||||
// 就诊账户管理只取回来一条数据?
|
||||
// List<Account> accountList = iAccountService.list(new LambdaQueryWrapper<Account>()
|
||||
// .in(Account::getId, paymentDto.getPatientId()).eq(Account::getEncounterId, paymentDto.getEncounterId()));
|
||||
Account account = new Account();
|
||||
Long accountId = null;
|
||||
boolean updateAccountSuccess = true;
|
||||
// if (accountList.size() != 0) {
|
||||
// account.setBalanceAmount(accountList.get(0).getBalanceAmount().add(paymentDto.getDisplayAmount()))
|
||||
// .setPatientId(paymentDto.getPatientId()).setEncounterId(encounter.getId());
|
||||
// // 更新就诊账户管理
|
||||
// updateAccountSuccess = iAccountService.saveOrUpdateAccount(account);
|
||||
// 账户ID
|
||||
// accountId = accountList.get(0).getId();
|
||||
// } else {
|
||||
// // 插入就诊账户管理
|
||||
// account.setTypeCode(AccountType.PERSONAL_CASH_ACCOUNT.getInfo()).setPatientId(paymentDto.getPatientId())
|
||||
// .setEncounterId(encounter.getId()).setBalanceAmount(paymentDto.getDisplayAmount());
|
||||
// // 账户ID
|
||||
// accountId = iAccountService.saveAccountByRegister(account);
|
||||
// }
|
||||
|
||||
// 结算
|
||||
// 统一生成业务流水
|
||||
String paymentNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.PAYMENT_NO.getPrefix(), 20);
|
||||
|
||||
// 获取预结算时的收费批次号
|
||||
String chrgBchno = redisCache.getCacheObject("PRE-SETTLE:PRE_SETTLE_" + paymentDto.getId());
|
||||
if (chrgBchno == null) {
|
||||
throw new ServiceException("请重新进行预交费");
|
||||
}
|
||||
// 处理时间
|
||||
Date setlTime = new Date();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(setlTime);
|
||||
calendar.add(Calendar.HOUR_OF_DAY, 24);
|
||||
Date futureTime = calendar.getTime();
|
||||
|
||||
// 新增支付信息
|
||||
PaymentReconciliation payment = new PaymentReconciliation();
|
||||
payment.setStatusEnum(PaymentStatus.SUCCESS.getValue()).setPaymentNo(paymentNo)
|
||||
.setPaymentEnum(PaymentType.PAY.getValue()).setPaymentReconciliationId(encounter.getPatientId())
|
||||
.setKindEnum(PaymentKind.HOSPITAL_DEPOSIT.getValue()).setEntererId(enterId)
|
||||
.setPatientId(encounter.getPatientId()).setPractitionerId(enterId)
|
||||
.setOutcomeEnum(PaymentOutcome.PARTIAL.getCode()).setLocationId(-99l).setExpirationDate(futureTime)
|
||||
// .setBillDate(setlTime).setPrintCount(0).setTenderedAmount(paymentDto.getTenderedAmount())
|
||||
.setEncounterId(encounter.getId());
|
||||
// 保存付款信息
|
||||
paymentReconciliationService.save(payment);
|
||||
// 保存付款详情
|
||||
this.savePaymentDetail(accountId, payment, paymentDto.getPaymentDetails());
|
||||
// 生成发票信息
|
||||
Invoice invoice = new Invoice();
|
||||
invoice.setPatientId(encounter.getPatientId()).setStatusEnum(InvoiceStatus.DRAFT)
|
||||
.setReconciliationId(payment.getId()).setStatusEnum(InvoiceStatus.ISSUED)// 待结算
|
||||
.setTypeCode(InvoiceType.ISSUING_INVOICES.getValue());
|
||||
iInvoiceService.save(invoice);
|
||||
|
||||
if (updateAccountSuccess) {
|
||||
return R.ok(payment, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"预收金"}));
|
||||
} else {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存付款详情
|
||||
*
|
||||
* @param payment 付款实体
|
||||
* @param paymentDetails 付款详情
|
||||
*/
|
||||
private void savePaymentDetail(long accountId, PaymentReconciliation payment,
|
||||
List<PaymentDetailDto> paymentDetails) {
|
||||
// 保存付款详情
|
||||
List<PaymentRecDetail> paymentRecDetails = new ArrayList<>();
|
||||
PaymentRecDetail paymentRecDetail;
|
||||
// 处理时间
|
||||
Date setlTime = new Date();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(setlTime);
|
||||
calendar.add(Calendar.HOUR_OF_DAY, 24);
|
||||
Date futureTime = calendar.getTime();
|
||||
|
||||
for (PaymentDetailDto paymentDetail : paymentDetails) {
|
||||
paymentRecDetail = new PaymentRecDetail();
|
||||
if (YbPayment.SELF_CASH_VX_VALUE.getValue().equals(paymentDetail.getPayEnum())) {
|
||||
paymentRecDetail = new PaymentRecDetail();
|
||||
paymentRecDetail.setReconciliationId(payment.getId())
|
||||
.setPayEnum(YbPayment.SELF_CASH_VX_VALUE.getValue())
|
||||
.setPayLevelEnum(YbPayment.SELF_CASH_VX_VALUE.getLevel()).setAmount(paymentDetail.getAmount())
|
||||
.setResultEnum(PaymentResult.PAID.getValue()).setPayTransDate(futureTime).setAccountId(accountId)
|
||||
.setAfterBalance(paymentDetail.getAmount());
|
||||
paymentRecDetails.add(paymentRecDetail);
|
||||
}
|
||||
if (YbPayment.SELF_CASH_ALI_VALUE.getValue().equals(paymentDetail.getPayEnum())) {
|
||||
paymentRecDetail = new PaymentRecDetail();
|
||||
paymentRecDetail.setReconciliationId(payment.getId())
|
||||
.setPayEnum(YbPayment.SELF_CASH_ALI_VALUE.getValue())
|
||||
.setPayLevelEnum(YbPayment.SELF_CASH_ALI_VALUE.getLevel()).setAmount(paymentDetail.getAmount())
|
||||
.setResultEnum(PaymentResult.PAID.getValue()).setPayTransDate(futureTime).setAccountId(accountId)
|
||||
.setAfterBalance(paymentDetail.getAmount());
|
||||
paymentRecDetails.add(paymentRecDetail);
|
||||
}
|
||||
if (YbPayment.SELF_CASH_UNION_VALUE.getValue().equals(paymentDetail.getPayEnum())) {
|
||||
paymentRecDetail = new PaymentRecDetail();
|
||||
paymentRecDetail.setReconciliationId(payment.getId())
|
||||
.setPayEnum(YbPayment.SELF_CASH_UNION_VALUE.getValue())
|
||||
.setPayLevelEnum(YbPayment.SELF_CASH_UNION_VALUE.getLevel()).setAmount(paymentDetail.getAmount())
|
||||
.setResultEnum(PaymentResult.PAID.getValue()).setPayTransDate(futureTime).setAccountId(accountId)
|
||||
.setAfterBalance(paymentDetail.getAmount());
|
||||
paymentRecDetails.add(paymentRecDetail);
|
||||
}
|
||||
if (YbPayment.SELF_CASH_VALUE.getValue().equals(paymentDetail.getPayEnum())) {
|
||||
paymentRecDetail = new PaymentRecDetail();
|
||||
paymentRecDetail.setReconciliationId(payment.getId()).setPayEnum(YbPayment.SELF_CASH_VALUE.getValue())
|
||||
.setPayLevelEnum(YbPayment.SELF_CASH_VALUE.getLevel()).setAmount(paymentDetail.getAmount())
|
||||
.setResultEnum(PaymentResult.PAID.getValue()).setPayTransDate(futureTime).setAccountId(accountId)
|
||||
.setAfterBalance(paymentDetail.getAmount());
|
||||
paymentRecDetails.add(paymentRecDetail);
|
||||
}
|
||||
}
|
||||
paymentRecDetailService.saveBatch(paymentRecDetails);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,394 @@
|
||||
package com.openhis.web.inpatientmanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
import com.openhis.common.enums.EncounterLocationStatus;
|
||||
import com.openhis.common.enums.LocationForm;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.document.domain.Emr;
|
||||
import com.openhis.document.domain.EmrTemplate;
|
||||
import com.openhis.document.domain.VitalSigns;
|
||||
import com.openhis.document.service.IEmrService;
|
||||
import com.openhis.document.service.IEmrTemplateService;
|
||||
import com.openhis.document.service.IVitalSignsService;
|
||||
import com.openhis.web.inpatientmanage.appservice.INursingRecordAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.*;
|
||||
import com.openhis.web.inpatientmanage.mapper.NursingRecordAppMapper;
|
||||
|
||||
/**
|
||||
* 护理记录单 实现类
|
||||
*
|
||||
* @author gyy
|
||||
* @since 2025/05/30
|
||||
*/
|
||||
@Service
|
||||
public class NursingRecordAppServiceImpl implements INursingRecordAppService {
|
||||
|
||||
@Resource
|
||||
private NursingRecordAppMapper nursingRecordAppMapper;
|
||||
|
||||
@Resource
|
||||
private IEmrService emrService;
|
||||
|
||||
@Resource
|
||||
private IVitalSignsService vitalSignsService;
|
||||
|
||||
@Resource
|
||||
private IPractitionerService practitionerService;
|
||||
|
||||
@Resource
|
||||
private IEmrTemplateService emrTemplateService;
|
||||
|
||||
/**
|
||||
* 获取住院患者信息 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPatientInfoPage(NursingSearchParam nursingSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<NursingSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(nursingSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo)),
|
||||
request);
|
||||
|
||||
// 分页查询,查询患者信息
|
||||
IPage<NursingPageDto> NursingInfoPage = nursingRecordAppMapper.getPatientPage(new Page<>(pageNo, pageSize),
|
||||
EncounterClass.IMP.getValue(), LocationForm.BED.getValue(), LocationForm.WARD.getValue(),
|
||||
EncounterLocationStatus.ACTIVE.getValue(), queryWrapper);
|
||||
|
||||
NursingInfoPage.getRecords().forEach(e -> {
|
||||
// 性别枚举类回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
e.setAgeString(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
});
|
||||
|
||||
// 返回【住院患者信息列表DTO】分页
|
||||
return R.ok(NursingInfoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者护理记录单信息 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者护理记录单信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getNursingPatientPage(NursingSearchParam nursingSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<NursingSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(nursingSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientId)), request);
|
||||
|
||||
// 分页查询,查询患者护理记录单信息
|
||||
IPage<NursingDetailDto> NursingPatientPage = nursingRecordAppMapper.getNursingPatientPage(
|
||||
new Page<>(pageNo, pageSize), EncounterClass.IMP.getValue(), LocationForm.BED.getValue(),
|
||||
LocationForm.WARD.getValue(), EncounterLocationStatus.ACTIVE.getValue(), queryWrapper);
|
||||
|
||||
NursingPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举类回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
e.setAgeString(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
});
|
||||
|
||||
// 返回【住院患者护理记录单信息列表DTO】分页
|
||||
return R.ok(NursingPatientPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存护理记录单
|
||||
*
|
||||
* @param nursingRecordDto 入参
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> saveRecord(NursingRecordDto nursingRecordDto) {
|
||||
// 取得记录人员id
|
||||
Long recorderId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
|
||||
Emr emr = new Emr();
|
||||
// 病历信息
|
||||
emr.setEncounterId(nursingRecordDto.getEncounterId()).setPatientId(nursingRecordDto.getPatientId())
|
||||
.setRecordId(recorderId).setRecordTime(nursingRecordDto.getRecordingTime()).setClassEnum(1)
|
||||
.setContextJson(nursingRecordDto.getContextJson());
|
||||
|
||||
// 病历(记录单)保存
|
||||
boolean saveSuccess = emrService.save(emr);
|
||||
// 是否同步到体征表
|
||||
if (nursingRecordDto.getVitalSignsSyncFlag()) {
|
||||
this.vitalSigns(nursingRecordDto, recorderId);
|
||||
}
|
||||
|
||||
if (saveSuccess) {
|
||||
return R.ok(nursingRecordDto,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"护理记录单"}));
|
||||
} else {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑护理记录单
|
||||
*
|
||||
* @param nursingRecordDto 入参
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> updateRecord(NursingRecordDto nursingRecordDto) {
|
||||
// 取得记录人员id
|
||||
Long recordId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
|
||||
// 病历(记录单)保存
|
||||
Emr emr = new Emr();
|
||||
emr.setId(nursingRecordDto.getRecordId()).setEncounterId(nursingRecordDto.getEncounterId())
|
||||
.setPatientId(nursingRecordDto.getPatientId()).setRecordId(recordId)
|
||||
.setRecordTime(nursingRecordDto.getRecordingTime()).setClassEnum(1)
|
||||
.setContextJson(nursingRecordDto.getContextJson());
|
||||
boolean updateSuccess = emrService.updateById(emr);
|
||||
|
||||
// 是否同步到体征表
|
||||
if (nursingRecordDto.getVitalSignsSyncFlag()) {
|
||||
this.vitalSigns(nursingRecordDto, recordId);
|
||||
} else {
|
||||
// 编辑时不同步到体征单的场合,删除体征单之前的记录
|
||||
this.deleteVitalSigns(nursingRecordDto);
|
||||
}
|
||||
|
||||
if (updateSuccess) {
|
||||
return R.ok(nursingRecordDto,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"护理记录单"}));
|
||||
} else {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑时不同步到体征单的场合,删除体征单之前的记录
|
||||
*
|
||||
* @param nursingRecordDto
|
||||
* @return 结果
|
||||
*/
|
||||
private void deleteVitalSigns(NursingRecordDto nursingRecordDto) {
|
||||
// 查询在体征表中是否存在数据
|
||||
LambdaQueryWrapper<VitalSigns> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(VitalSigns::getEncounterId, nursingRecordDto.getEncounterId())
|
||||
.eq(VitalSigns::getPatientId, nursingRecordDto.getPatientId())
|
||||
.eq(VitalSigns::getTimePoint, nursingRecordDto.getRecordingTime());
|
||||
List<VitalSigns> vitalSignsList = vitalSignsService.list(queryWrapper);
|
||||
// 存在的场合删除记录
|
||||
if (vitalSignsList.size() != 0) {
|
||||
// 获取生命体征管理ID的List
|
||||
List<Long> vitalSignsIdList = vitalSignsList.stream().map(VitalSigns::getId).collect(Collectors.toList());
|
||||
// 删除记录
|
||||
vitalSignsService.removeByIds(vitalSignsIdList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生命体征转换,同步到体征单
|
||||
*
|
||||
* @param nursingRecordDto
|
||||
* @return 结果
|
||||
*/
|
||||
private void vitalSigns(NursingRecordDto nursingRecordDto, long recorderId) {
|
||||
|
||||
// 取得记录人员姓名
|
||||
Practitioner practitioner = practitionerService.getById(recorderId);
|
||||
// 体征转换
|
||||
NursingVitalSignsDto nursingVitalSigns =
|
||||
JSONObject.parseObject(nursingRecordDto.getContextJson(), NursingVitalSignsDto.class);
|
||||
// 体温
|
||||
String tw = nursingVitalSigns.getTw();
|
||||
// 脉搏
|
||||
String mb = nursingVitalSigns.getMb();
|
||||
// 呼吸
|
||||
String hx = nursingVitalSigns.getHx();
|
||||
|
||||
if (tw != null && tw.length() > 0) {
|
||||
// 体征表保存或更新(体温)
|
||||
VitalSigns vitalSigns = new VitalSigns();
|
||||
vitalSigns.setPatientId(nursingRecordDto.getPatientId()).setEncounterId(nursingRecordDto.getEncounterId())
|
||||
.setRecordingDate(nursingRecordDto.getRecordingTime()).setTimePoint(nursingRecordDto.getRecordingTime())
|
||||
.setRecorder(practitioner.getName()).setVitalSignsCode("007").setVitalSignsValues(tw);
|
||||
vitalSignsService.saveOrUpdateVitalSigns(vitalSigns);
|
||||
} else {
|
||||
// 体温未录入时,体征表之前存储的体温数据删除
|
||||
VitalSigns vitalSigns = new VitalSigns();
|
||||
vitalSigns.setEncounterId(nursingRecordDto.getEncounterId())
|
||||
.setTimePoint(nursingRecordDto.getRecordingTime()).setVitalSignsCode("007");
|
||||
vitalSignsService.deleteVitalSigns(vitalSigns);
|
||||
}
|
||||
if (mb != null && mb.length() > 0) {
|
||||
// 体征表保存或更新(脉搏)
|
||||
VitalSigns vitalSigns = new VitalSigns();
|
||||
vitalSigns.setPatientId(nursingRecordDto.getPatientId()).setEncounterId(nursingRecordDto.getEncounterId())
|
||||
.setRecordingDate(nursingRecordDto.getRecordingTime()).setTimePoint(nursingRecordDto.getRecordingTime())
|
||||
.setRecorder(practitioner.getName()).setVitalSignsCode("003").setVitalSignsValues(mb);
|
||||
vitalSignsService.saveOrUpdateVitalSigns(vitalSigns);
|
||||
} else {
|
||||
// 脉搏未录入时,体征表之前存储的脉搏数据删除
|
||||
VitalSigns vitalSigns = new VitalSigns();
|
||||
vitalSigns.setEncounterId(nursingRecordDto.getEncounterId())
|
||||
.setTimePoint(nursingRecordDto.getRecordingTime()).setVitalSignsCode("003");
|
||||
vitalSignsService.deleteVitalSigns(vitalSigns);
|
||||
}
|
||||
if (hx != null && hx.length() > 0) {
|
||||
// 体征表保存或更新(呼吸)
|
||||
VitalSigns vitalSigns = new VitalSigns();
|
||||
vitalSigns.setPatientId(nursingRecordDto.getPatientId()).setEncounterId(nursingRecordDto.getEncounterId())
|
||||
.setRecordingDate(nursingRecordDto.getRecordingTime()).setTimePoint(nursingRecordDto.getRecordingTime())
|
||||
.setRecorder(practitioner.getName()).setVitalSignsCode("006").setVitalSignsValues(hx);
|
||||
vitalSignsService.saveOrUpdateVitalSigns(vitalSigns);
|
||||
} else {
|
||||
// 呼吸未录入时,体征表之前存储的呼吸数据删除
|
||||
VitalSigns vitalSigns = new VitalSigns();
|
||||
vitalSigns.setEncounterId(nursingRecordDto.getEncounterId())
|
||||
.setTimePoint(nursingRecordDto.getRecordingTime()).setVitalSignsCode("006");
|
||||
vitalSignsService.deleteVitalSigns(vitalSigns);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理记录单
|
||||
*
|
||||
* @param recordList 记录单list
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> delRecord(List<NursingRecordDto> recordList) {
|
||||
|
||||
for (NursingRecordDto record : recordList) {
|
||||
// 病历(记录单)删除
|
||||
emrService.removeById(record.getRecordId());
|
||||
// 查询在体征表中是否存在数据
|
||||
LambdaQueryWrapper<VitalSigns> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(VitalSigns::getEncounterId, record.getEncounterId())
|
||||
.eq(VitalSigns::getPatientId, record.getPatientId())
|
||||
.eq(VitalSigns::getTimePoint, record.getRecordingTime());
|
||||
List<VitalSigns> vitalSignsList = vitalSignsService.list(queryWrapper);
|
||||
// 存在的场合删除记录
|
||||
if (vitalSignsList.size() != 0) {
|
||||
// 获取生命体征管理ID的List
|
||||
List<Long> vitalSignsIdList =
|
||||
vitalSignsList.stream().map(VitalSigns::getId).collect(Collectors.toList());
|
||||
// 删除记录
|
||||
vitalSignsService.removeByIds(vitalSignsIdList);
|
||||
}
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子病历模板列表 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 电子病历模板信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEmrTemplate(NursingSearchParam nursingSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<NursingSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(nursingSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("template_name")), request);
|
||||
|
||||
// 分页查询,查询电子病历模板信息
|
||||
IPage<NursingEmrTemplateDto> emrTemplatePage =
|
||||
nursingRecordAppMapper.getEmrTemplate(new Page<>(pageNo, pageSize), "1", queryWrapper);
|
||||
|
||||
// 返回【电子病历模板】分页
|
||||
return R.ok(emrTemplatePage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存病历模板
|
||||
*
|
||||
* @param emrTemplateDto 病历模板信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> saveEmrTemplate(NursingEmrTemplateDto emrTemplateDto) {
|
||||
|
||||
EmrTemplate emrTemplate = new EmrTemplate();
|
||||
// 保存病历模板信息
|
||||
emrTemplate.setTemplateName(emrTemplateDto.getTemplateName()).setTemplateTypeCode("1")
|
||||
.setUseScopeCode(emrTemplateDto.getUseScopeCode()).setUserId(emrTemplateDto.getUserId())
|
||||
.setContextJson(emrTemplateDto.getContextJson());
|
||||
|
||||
return emrTemplateService.save(emrTemplate) ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除病历模板
|
||||
*
|
||||
* @param idList 模板id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteEmrTemplate(List<Long> idList) {
|
||||
return emrTemplateService.removeByIds(idList) ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑病历模板
|
||||
*
|
||||
* @param emrTemplateDto 病历模板信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> updateEmrTemplate(NursingEmrTemplateDto emrTemplateDto) {
|
||||
|
||||
EmrTemplate emrTemplate = new EmrTemplate();
|
||||
// 病历模板信息更新
|
||||
emrTemplate.setId(emrTemplateDto.getId()).setTemplateName(emrTemplateDto.getTemplateName())
|
||||
.setTemplateTypeCode("1").setUseScopeCode(emrTemplateDto.getUseScopeCode())
|
||||
.setUserId(emrTemplateDto.getUserId()).setContextJson(emrTemplateDto.getContextJson());
|
||||
|
||||
return emrTemplateService.updateById(emrTemplate) ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package com.openhis.web.inpatientmanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.administration.domain.EncounterLocation;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IEncounterLocationService;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.ybenums.PriorityType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.chargemanage.dto.OrgMetadata;
|
||||
import com.openhis.web.inpatientmanage.appservice.IPatientHomeAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeDto;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeEmptyBedDto;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeSearchParam;
|
||||
import com.openhis.web.inpatientmanage.mapper.PatientHomeAppMapper;
|
||||
|
||||
/**
|
||||
* 患者首页 实现类
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Service
|
||||
public class PatientHomeAppServiceImpl implements IPatientHomeAppService {
|
||||
|
||||
@Resource
|
||||
private PatientHomeAppMapper patientHomeAppMapper;
|
||||
|
||||
@Resource
|
||||
private ILocationService locationService;
|
||||
|
||||
@Resource
|
||||
private IEncounterLocationService encounterLocationService;
|
||||
|
||||
@Resource
|
||||
private IOrganizationService iOrganizationService;
|
||||
|
||||
@Resource
|
||||
private IEncounterService encounterService;
|
||||
|
||||
/**
|
||||
* 患者首页信息初期数据列表
|
||||
*
|
||||
* @return 患者首页初期数据列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPatientInfoInit(PatientHomeSearchParam patientHomeSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<PatientHomeDto> queryWrapper = HisQueryUtils.buildQueryWrapper(patientHomeSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("inpatientNumber", "name", "responsibleDoctor", "responsibleNurse")), request);
|
||||
|
||||
// 分页查询,查询患者信息
|
||||
IPage<PatientHomeDto> patientHomeInfoPage = patientHomeAppMapper.getPage(new Page<>(pageNo, pageSize),
|
||||
patientHomeSearchParam.getStatusEnum(), patientHomeSearchParam.getPatientId(), searchKey, queryWrapper);
|
||||
|
||||
patientHomeInfoPage.getRecords().forEach(e -> {
|
||||
// 护理级别
|
||||
e.setPriorityEnum_enumText(EnumUtils.getInfoByValue(PriorityType.class, e.getPriorityEnum()));
|
||||
// 费别
|
||||
e.setTypeCode_dictText(EnumUtils.getInfoByValue(AccountType.class, e.getTypeCode()));
|
||||
// 血型ABO
|
||||
e.setBloodAbo_enumText(EnumUtils.getInfoByValue(BloodTypeABO.class, e.getBloodAbo()));
|
||||
// 血型RH
|
||||
e.setBloodRh_enumText(EnumUtils.getInfoByValue(BloodTypeRH.class, e.getBloodRh()));
|
||||
// 患者状态
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(EncounterStatus.class, e.getStatusEnum()));
|
||||
// 职业
|
||||
e.setPrfsEnum_enumText(EnumUtils.getInfoByValue(OccupationType.class, e.getPrfsEnum()));
|
||||
// 联系人关系
|
||||
e.setLinkRelationCode_codeText(
|
||||
EnumUtils.getInfoByValue(FamilyRelationshipType.class, e.getLinkRelationCode()));
|
||||
// 婚姻状态
|
||||
e.setMaritalStatusEnum_enumText(EnumUtils.getInfoByValue(MaritalStatus.class, e.getMaritalStatusEnum()));
|
||||
// 就诊类别
|
||||
e.setClassEnum_enumText(EnumUtils.getInfoByValue(EncounterClass.class, e.getClassEnum()));
|
||||
// 性别枚举类回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
e.setAgeString(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
// 计算住院天数
|
||||
if (e.getClassEnum() == EncounterClass.IMP.getValue()) {
|
||||
// 截至时间,用于计算当前时刻下显示的住院天数
|
||||
if (e.getAdmissionDate() != null) {
|
||||
Date endTime;
|
||||
if (e.getDischargeDate() == null) {
|
||||
endTime = DateUtils.getNowDate();
|
||||
} else {
|
||||
endTime = e.getDischargeDate();
|
||||
}
|
||||
|
||||
int days = DateUtils.differentDaysByMillisecond(e.getAdmissionDate(), endTime);
|
||||
e.setHospitalizationDays(days);
|
||||
}
|
||||
}
|
||||
// 手术状态
|
||||
e.setSurgeryStatusEnum_enumText(EnumUtils.getInfoByValue(EventStatus.class, e.getSurgeryStatusEnum()));
|
||||
// 计算术后天数
|
||||
if (e.getSurgeryStatusEnum() == EventStatus.COMPLETED.getValue()) {
|
||||
// 截至时间,用于计算当前时刻下显示的术后天数
|
||||
if (e.getSurgeryStartTime() != null && e.getSurgeryEndTime() != null) {
|
||||
Date endTime = e.getSurgeryEndTime();
|
||||
int days = DateUtils.differentDaysByMillisecond(endTime, DateUtils.getNowDate());
|
||||
e.setPostoperativeDays(days);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// 返回【患者信息列表DTO】分页
|
||||
return R.ok(patientHomeInfoPage);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 空床详细查询
|
||||
*
|
||||
* @param organizationId 科室ID
|
||||
* @return 空床详细查询
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEmptyBed(Long organizationId) {
|
||||
// 查询科室空床
|
||||
List<PatientHomeEmptyBedDto> emptyBedList = patientHomeAppMapper.getEmptyBedList(organizationId);
|
||||
|
||||
return R.ok(emptyBedList);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转床确认
|
||||
*
|
||||
* @param encounterLocationId 就诊位置ID
|
||||
* @param encounterId 就诊ID
|
||||
* @param oldLocationId 旧位置ID
|
||||
* @param newLocationId 新位置ID
|
||||
* @return 转床结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> saveBedTransfer(Long encounterLocationId, Long encounterId, Long oldLocationId, Long newLocationId) {
|
||||
|
||||
// 1.就诊位置ID变更
|
||||
EncounterLocation encounterLocation = new EncounterLocation();
|
||||
encounterLocation.setId(encounterLocationId)
|
||||
// 设置就诊ID
|
||||
.setEncounterId(encounterId)
|
||||
// 设置位置ID
|
||||
.setLocationId(newLocationId)
|
||||
// 设置物理枚举为 8:病床
|
||||
.setFormEnum(LocationForm.BED.getValue())
|
||||
// 状态为使用中
|
||||
.setStatusEnum(EncounterLocationStatus.ACTIVE.getValue());
|
||||
encounterLocationService.saveOrUpdateEncounterLocation(encounterLocation);
|
||||
|
||||
// 2.位置表
|
||||
// 旧病床状态变更(空闲)
|
||||
locationService.updateStatusById(oldLocationId, LocationBedStatus.U.getValue());
|
||||
|
||||
// 新病床状态变更(占用)
|
||||
locationService.updateStatusById(newLocationId, LocationBedStatus.O.getValue());
|
||||
// 转床结果
|
||||
return R.ok(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 科室信息
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
@Override
|
||||
public List<OrgMetadata> getCaty() {
|
||||
List<Organization> list = iOrganizationService.getList(OrganizationType.DEPARTMENT.getValue(),
|
||||
OrganizationClass.INPATIENT.getValue());
|
||||
List<OrgMetadata> orgMetadataList = new ArrayList<>();
|
||||
OrgMetadata orgMetadata;
|
||||
for (Organization organization : list) {
|
||||
orgMetadata = new OrgMetadata();
|
||||
BeanUtils.copyProperties(organization, orgMetadata);
|
||||
orgMetadataList.add(orgMetadata);
|
||||
}
|
||||
return orgMetadataList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转科确认
|
||||
*
|
||||
* @param encounterId 就诊ID
|
||||
* @param organizationId 机构ID
|
||||
* @return 转科结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> saveDepartmentTransfer(Long encounterLocationId, Long patientId, Long encounterId, Long organizationId,
|
||||
Date DepartmentTransferYmd) {
|
||||
|
||||
boolean encounterSuccess;
|
||||
// 1.就诊管理表变更
|
||||
// 科室变更
|
||||
Encounter encounter = new Encounter();
|
||||
// 就诊ID
|
||||
encounter.setId(encounterId)
|
||||
// 患者ID
|
||||
.setPatientId(patientId)
|
||||
// 机构ID
|
||||
.setOrganizationId(organizationId);
|
||||
|
||||
encounterService.saveOrUpdateEncounter(encounter);
|
||||
|
||||
// 2.就诊位置表变更
|
||||
// 就诊位置ID变更
|
||||
EncounterLocation encounterLocation = new EncounterLocation();
|
||||
encounterLocation.setId(encounterLocationId)
|
||||
// 设置就诊ID
|
||||
.setEncounterId(encounterId)
|
||||
// 设置开始时间
|
||||
.setStartTime(DepartmentTransferYmd)
|
||||
// 设置物理枚举为 8:病床
|
||||
.setFormEnum(LocationForm.BED.getValue());
|
||||
encounterSuccess = encounterLocationService.saveOrUpdateEncounterLocation(encounterLocation);
|
||||
|
||||
// 转床结果
|
||||
return R.ok(encounterSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出院确认
|
||||
*
|
||||
* @param patientId 患者ID
|
||||
* @param encounterId 就诊ID
|
||||
* @return 转科结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> saveDischargeHospital(Long encounterLocationId, Long patientId, Long encounterId, Long locationId,
|
||||
Date DischargeHospitalYmd) {
|
||||
|
||||
// 出院
|
||||
boolean encounterSuccess;
|
||||
// 1.就诊管理表
|
||||
Encounter encounter = new Encounter();
|
||||
// 就诊ID
|
||||
encounter.setId(encounterId)
|
||||
// 患者ID
|
||||
.setPatientId(patientId)
|
||||
// 状态编码
|
||||
.setStatusEnum(EncounterStatus.COMPLETED.getValue())
|
||||
// 结束时间
|
||||
.setEndTime(DischargeHospitalYmd);
|
||||
|
||||
encounterService.saveOrUpdateEncounter(encounter);
|
||||
|
||||
// 2.就诊位置表变更
|
||||
// 就诊位置ID变更
|
||||
EncounterLocation encounterLocation = new EncounterLocation();
|
||||
encounterLocation.setId(encounterLocationId)
|
||||
// 设置就诊ID
|
||||
.setEncounterId(encounterId)
|
||||
// 设置状态枚举
|
||||
.setStatusEnum(EncounterLocationStatus.COMPLETED.getValue())
|
||||
// 设置物理枚举为 8:病床
|
||||
.setFormEnum(LocationForm.BED.getValue());
|
||||
encounterLocationService.saveOrUpdateEncounterLocation(encounterLocation);
|
||||
|
||||
// 3.位置表
|
||||
// 旧病床状态变更(空闲)
|
||||
encounterSuccess = locationService.updateStatusById(locationId, LocationBedStatus.U.getValue());
|
||||
|
||||
// 转床结果
|
||||
return R.ok(encounterSuccess);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,472 @@
|
||||
package com.openhis.web.inpatientmanage.appservice.impl;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
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.core.domain.entity.SysUser;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.TimeUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.document.domain.VitalSigns;
|
||||
import com.openhis.document.service.IVitalSignsService;
|
||||
import com.openhis.web.inpatientmanage.appservice.IVitalSignsAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.*;
|
||||
import com.openhis.web.inpatientmanage.mapper.VitalSignsAppMapper;
|
||||
|
||||
/**
|
||||
* 三测单 实现类
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@Service
|
||||
public class VitalSignsAppServiceImpl implements IVitalSignsAppService {
|
||||
|
||||
@Resource
|
||||
private VitalSignsAppMapper vitalSignsAppMapper;
|
||||
|
||||
@Resource
|
||||
private IVitalSignsService vitalSignsService;
|
||||
|
||||
/**
|
||||
* 三测单-患者信息查询
|
||||
*
|
||||
* @return 三测单-患者信息数据列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getVitalSignsInfo(VitalSignsSearchParam vitalSignsSearchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<VitalSignsDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(vitalSignsSearchParam, searchKey, new HashSet<>(), request);
|
||||
|
||||
// 分页查询,查询患者信息
|
||||
IPage<VitalSignsDto> vitalSignsInfoPage = vitalSignsAppMapper.getVitalSignsInfo(new Page<>(pageNo, pageSize),
|
||||
vitalSignsSearchParam.getPatientId(), searchKey, queryWrapper);
|
||||
|
||||
VitalSignsMedicalRecordDto medicalRecord = new VitalSignsMedicalRecordDto();
|
||||
|
||||
// 处理日期
|
||||
if (!vitalSignsInfoPage.getRecords().isEmpty()) {
|
||||
medicalRecord.setHospDate(vitalSignsInfoPage.getRecords().get(0).getRecordingDate());
|
||||
}
|
||||
|
||||
// 处理生命体征数据
|
||||
Map<Integer, VitalSignsTemperaturePulsesDto> groupMap = new HashMap<>();
|
||||
List<VitalSignsDto> vitalSignsInfoPageList = vitalSignsInfoPage.getRecords();
|
||||
|
||||
vitalSignsInfoPageList.forEach(item -> {
|
||||
|
||||
// 就诊类别
|
||||
item.setClassEnum_enumText(EnumUtils.getInfoByValue(EncounterClass.class, item.getClassEnum()));
|
||||
|
||||
// 手术状态
|
||||
item.setSurgeryStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(EventStatus.class, item.getSurgeryStatusEnum()));
|
||||
|
||||
// 计算完整周数
|
||||
if (item.getClassEnum() == EncounterClass.IMP.getValue()) {
|
||||
// 转换为 LocalDate 进行日期计算
|
||||
LocalDate admissionDate = TimeUtils.dateToLocalDate(item.getAdmissionDate());
|
||||
LocalDate recordingDate = TimeUtils.dateToLocalDate(item.getRecordingDate());
|
||||
|
||||
// 计算天数差
|
||||
long dayDiff = ChronoUnit.DAYS.between(admissionDate, recordingDate);
|
||||
int hospitalizationDays = (int)(dayDiff + 1);
|
||||
item.setHospitalizationDays(hospitalizationDays);
|
||||
|
||||
// 计算周数(向上取整)
|
||||
int weekNo = (hospitalizationDays + 6) / 7;
|
||||
item.setWeekNo(weekNo);
|
||||
}
|
||||
|
||||
// 计算术后天数
|
||||
// 手术已完成的患者
|
||||
if (item.getSurgeryStatusEnum() == EventStatus.COMPLETED.getValue()) {
|
||||
if (item.getSurgeryStartTime() != null && item.getSurgeryEndTime() != null) {
|
||||
// 手术结束时间的类型转换
|
||||
LocalDate endTime = TimeUtils.dateToLocalDate(item.getSurgeryEndTime());
|
||||
// 记录日期的类型转换
|
||||
LocalDate recordingtime = TimeUtils.dateToLocalDate(item.getRecordingDate());
|
||||
// 术后天数计算
|
||||
int surgeryDays = (int)ChronoUnit.DAYS.between(endTime, recordingtime);
|
||||
// 设置术后天数
|
||||
item.setPostoperativeDays(surgeryDays);
|
||||
}
|
||||
}
|
||||
Integer weekNo = item.getWeekNo();
|
||||
VitalSignsTemperaturePulsesDto group = groupMap.computeIfAbsent(weekNo, k -> {
|
||||
VitalSignsTemperaturePulsesDto newGroup = new VitalSignsTemperaturePulsesDto();
|
||||
newGroup.setWeekNo(weekNo);
|
||||
return newGroup;
|
||||
});
|
||||
|
||||
// 格式化时间
|
||||
Date recordingDate = item.getRecordingDate();
|
||||
String dateStr = TimeUtils.dateToDateString(recordingDate);
|
||||
Date timePoint = item.getTimePoint();
|
||||
String timeStr = TimeUtils.dateToTimeString(timePoint);
|
||||
|
||||
// 体温单列表做成
|
||||
VitalSignsChartSmallDto chartSmall = new VitalSignsChartSmallDto();
|
||||
chartSmall.setCollectionMode(2);
|
||||
chartSmall.setDate(dateStr);
|
||||
chartSmall.setTimes(timeStr);
|
||||
chartSmall.setTypeCode(item.getVitalSignsCode());
|
||||
chartSmall.setTypeValue(item.getVitalSignsValues());
|
||||
chartSmall.setWeekNo(weekNo);
|
||||
chartSmall.setPostoperativeDays(item.getPostoperativeDays());
|
||||
group.getChartsSmalls().add(chartSmall);
|
||||
group.setWeekNo(weekNo);
|
||||
});
|
||||
|
||||
medicalRecord.setTemperaturePulses(new ArrayList<>(groupMap.values()));
|
||||
|
||||
// 返回【患者信息列表DTO】分页
|
||||
return R.ok(medicalRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 体温单记录保存
|
||||
*
|
||||
* @param vitalSignsSaveDto 患者体征信息
|
||||
* @return 保存结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> saveVitalSigns(VitalSignsSaveDto vitalSignsSaveDto) {
|
||||
// 参数校验
|
||||
if (vitalSignsSaveDto == null) {
|
||||
return R.fail("生命体征记录不能为空");
|
||||
}
|
||||
|
||||
// 获取当前登录用户
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser == null) {
|
||||
return R.fail("未获取到登录用户信息");
|
||||
}
|
||||
SysUser user = loginUser.getUser();
|
||||
List<VitalSigns> vitalSignsList = new ArrayList<>();
|
||||
|
||||
// 解析时间点
|
||||
LocalTime timePoint = TimeUtils.parseTime(vitalSignsSaveDto.getTimePoint());
|
||||
if (timePoint == null) {
|
||||
return R.fail("时间格式解析失败");
|
||||
}
|
||||
|
||||
// 创建基础生命体征记录
|
||||
VitalSigns baseRecord = new VitalSigns();
|
||||
baseRecord.setPatientId(vitalSignsSaveDto.getPatientId()).setEncounterId(vitalSignsSaveDto.getEncounterId())
|
||||
.setRecordingDate(vitalSignsSaveDto.getRecordingDate()).setTimePoint(TimeUtils.localTimeToDate(timePoint))
|
||||
.setLocationId(vitalSignsSaveDto.getLocationId()).setRecorder(user.getUserName())
|
||||
.setRemake(vitalSignsSaveDto.getRemake());
|
||||
|
||||
// 使用反射获取所有生命体征字段
|
||||
Field[] fields = VitalSignsSaveDto.class.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
// 通过注解判断是否为生命体征字段
|
||||
VitalSignsField vitalSignsField = field.getAnnotation(VitalSignsField.class);
|
||||
if (vitalSignsField == null) {
|
||||
continue; // 跳过非生命体征字段
|
||||
}
|
||||
|
||||
// 设置字段可访问
|
||||
field.setAccessible(true);
|
||||
|
||||
try {
|
||||
// 获取字段值
|
||||
Object fieldValue = field.get(vitalSignsSaveDto);
|
||||
if (fieldValue == null) {
|
||||
continue; // 跳过null值
|
||||
}
|
||||
|
||||
String value;
|
||||
if (fieldValue instanceof String) {
|
||||
value = (String)fieldValue;
|
||||
if (value.trim().isEmpty()) {
|
||||
continue; // 跳过空字符串
|
||||
}
|
||||
} else {
|
||||
value = fieldValue.toString(); // 其他类型转换为字符串
|
||||
}
|
||||
|
||||
// 校验生命体征编码
|
||||
String code = vitalSignsField.code();
|
||||
if (code == null || code.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取单位
|
||||
String unit = vitalSignsField.unit();
|
||||
if (unit == null || unit.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 构建生命体征记录
|
||||
VitalSigns record = cloneVitalSignsRecord(baseRecord);
|
||||
record.setVitalSignsCode(code);
|
||||
record.setVitalSignsValues(value);
|
||||
record.setUnits(unit);
|
||||
|
||||
vitalSignsList.add(record);
|
||||
|
||||
} catch (IllegalAccessException | ClassCastException e) {
|
||||
return R.fail("生命体征数据格式错误");
|
||||
}
|
||||
}
|
||||
|
||||
if (vitalSignsList.isEmpty()) {
|
||||
return R.fail("未检测到有效的生命体征数据");
|
||||
}
|
||||
|
||||
// 检查记录是否已存在
|
||||
boolean existingRecordCount = vitalSignsService.selectBatchVitalSigns(vitalSignsList);
|
||||
|
||||
// 存在
|
||||
if (existingRecordCount) {
|
||||
// 原纪录删除
|
||||
vitalSignsAppMapper.deleteVitalSigns(vitalSignsList.get(0).getPatientId(),
|
||||
vitalSignsList.get(0).getEncounterId(), vitalSignsList.get(0).getRecordingDate(),
|
||||
vitalSignsList.get(0).getTimePoint());
|
||||
}
|
||||
boolean saveResult = vitalSignsService.saveOrUpdateBatchVitalSigns(vitalSignsList);
|
||||
|
||||
return saveResult ? R.ok("保存成功") : R.fail("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者体温单检索
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 检索结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> searchVitalSigns(String startTime, String endTime) {
|
||||
|
||||
// 基本信息查询
|
||||
List<VitalSigns> vitalSignsList = vitalSignsAppMapper.searchVitalSigns(startTime, endTime);
|
||||
// 判断查询结果是否为空
|
||||
if (vitalSignsList.isEmpty()) {
|
||||
return R.ok(Collections.emptyList());
|
||||
}
|
||||
|
||||
// 创建属性映射表
|
||||
Map<String, BiConsumer<VitalSignSearchRecordDto, String>> propertySetterMap =
|
||||
createPropertySetterMapUsingReflection();
|
||||
|
||||
// 按日期时间分组处理数据
|
||||
List<VitalSignSearchRecordDto> resultList = new ArrayList<>();
|
||||
VitalSignSearchRecordDto currentRecord = null;
|
||||
String currentDateTimeKey = null;
|
||||
|
||||
for (VitalSigns item : vitalSignsList) {
|
||||
// 生成日期时间键
|
||||
String dateStr = TimeUtils.dateToDateString(item.getRecordingDate());
|
||||
String timeStr = TimeUtils.dateToTimeString(item.getTimePoint());
|
||||
String dateTimeKey = dateStr + " " + timeStr;
|
||||
|
||||
// 如果日期时间变化,创建新记录
|
||||
if (!dateTimeKey.equals(currentDateTimeKey)) {
|
||||
if (currentRecord != null && isRecordValid(currentRecord)) {
|
||||
resultList.add(currentRecord);
|
||||
}
|
||||
currentRecord = new VitalSignSearchRecordDto();
|
||||
currentDateTimeKey = dateTimeKey;
|
||||
|
||||
// 设置日期时间
|
||||
currentRecord.setRecordingDate(dateStr);
|
||||
currentRecord.setTimePoint(timeStr);
|
||||
}
|
||||
|
||||
// 获取代码对应的字段
|
||||
String fieldName =
|
||||
AnnotationConverter.getFieldNameByCode(VitalSignSearchRecordDto.class, item.getVitalSignsCode());
|
||||
// 设置生命体征值
|
||||
BiConsumer<VitalSignSearchRecordDto, String> setter = propertySetterMap.get(fieldName);
|
||||
if (setter != null) {
|
||||
setter.accept(currentRecord, item.getVitalSignsValues());
|
||||
}
|
||||
}
|
||||
|
||||
// 添加最后一条记录
|
||||
if (currentRecord != null && isRecordValid(currentRecord)) {
|
||||
resultList.add(currentRecord);
|
||||
}
|
||||
|
||||
return R.ok(resultList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 体温单记录删除
|
||||
*
|
||||
* @param vitalSignsDeleteDto 患者体征信息
|
||||
* @return 删除结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> deleteVitalSigns(List<VitalSignsDeleteDto> vitalSignsDeleteDto) {
|
||||
|
||||
List<VitalSigns> vitalSignsList = new ArrayList<>();
|
||||
|
||||
for (VitalSignsDeleteDto deleteDto : vitalSignsDeleteDto) {
|
||||
|
||||
// 记录日期的格式化
|
||||
LocalDateTime recordDateTime = TimeUtils.parseDateTime(deleteDto.getRecordingDate());
|
||||
Date date = Date.from(recordDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
|
||||
// 记录时间的格式化
|
||||
LocalDateTime timePoint =
|
||||
TimeUtils.parseDateTime(deleteDto.getRecordingDate().substring(0, 11) + deleteDto.getTimePoint());
|
||||
Date time = Date.from(timePoint.atZone(ZoneId.systemDefault()).toInstant());
|
||||
|
||||
VitalSigns vitalSigns = new VitalSigns();
|
||||
// 设置患者ID
|
||||
vitalSigns.setPatientId(deleteDto.getPatientId())
|
||||
// 设置就诊ID
|
||||
.setEncounterId(deleteDto.getEncounterId())
|
||||
// 设置记录日期
|
||||
.setRecordingDate(date)
|
||||
// 设置记录时间
|
||||
.setTimePoint(time);
|
||||
|
||||
vitalSignsList.add(vitalSigns);
|
||||
// 确认删除的数据是否存在
|
||||
boolean existingRecord = vitalSignsService.selectBatchVitalSigns(vitalSignsList);
|
||||
|
||||
// 数据不存在
|
||||
if (!existingRecord) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
} else {
|
||||
// 数据存在(删除记录)
|
||||
vitalSignsAppMapper.deleteVitalSigns(deleteDto.getPatientId(), deleteDto.getEncounterId(), date, time);
|
||||
}
|
||||
}
|
||||
return R.ok(null);
|
||||
}
|
||||
|
||||
// 克隆生命体征记录对象
|
||||
private VitalSigns cloneVitalSignsRecord(VitalSigns baseRecord) {
|
||||
try {
|
||||
// 序列化方式实现深拷贝
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(baseRecord);
|
||||
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
|
||||
ObjectInputStream ois = new ObjectInputStream(bais);
|
||||
return (VitalSigns)ois.readObject();
|
||||
} catch (Exception e) {
|
||||
// 浅拷贝作为降级方案
|
||||
VitalSigns record = new VitalSigns();
|
||||
BeanUtils.copyProperties(baseRecord, record);
|
||||
return record;
|
||||
}
|
||||
}
|
||||
|
||||
// 使用反射自动生成属性映射表
|
||||
private Map<String, BiConsumer<VitalSignSearchRecordDto, String>> createPropertySetterMapUsingReflection() {
|
||||
Map<String, BiConsumer<VitalSignSearchRecordDto, String>> map = new HashMap<>();
|
||||
|
||||
// 获取所有方法
|
||||
Method[] methods = VitalSignSearchRecordDto.class.getMethods();
|
||||
|
||||
// 遍历方法,筛选出符合条件的setter
|
||||
for (Method method : methods) {
|
||||
String methodName = method.getName();
|
||||
|
||||
// 判断是否为setter方法:以"set"开头,有一个参数
|
||||
if (methodName.startsWith("set") && method.getParameterCount() == 1) {
|
||||
// 获取属性名
|
||||
String propertyName = methodName.substring(3); // 去掉"set"前缀
|
||||
if (propertyName.length() > 0) {
|
||||
// 将属性名首字母小写
|
||||
propertyName = propertyName.substring(0, 1).toLowerCase() + propertyName.substring(1);
|
||||
|
||||
// 参数类型检查:确保参数类型是String或可以转换为String
|
||||
Class<?> paramType = method.getParameterTypes()[0];
|
||||
if (paramType == String.class) {
|
||||
// 使用方法引用创建BiConsumer
|
||||
BiConsumer<VitalSignSearchRecordDto, String> setter = (obj, value) -> {
|
||||
try {
|
||||
method.invoke(obj, value);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("设置属性值失败");
|
||||
}
|
||||
};
|
||||
|
||||
map.put(propertyName, setter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// 转换工具类
|
||||
public class AnnotationConverter {
|
||||
// 根据代码查找对应的字段名
|
||||
public static String getFieldNameByCode(Class<?> clazz, String code) {
|
||||
for (Field field : clazz.getDeclaredFields()) {
|
||||
VitalSignsField annotation = field.getAnnotation(VitalSignsField.class);
|
||||
if (annotation != null && annotation.code().equals(code)) {
|
||||
return annotation.name();
|
||||
}
|
||||
}
|
||||
return "未知代码";
|
||||
}
|
||||
|
||||
// 根据字段名查找对应的代码
|
||||
public static String getCodeByFieldName(Class<?> clazz, String fieldName) {
|
||||
for (Field field : clazz.getDeclaredFields()) {
|
||||
VitalSignsField annotation = field.getAnnotation(VitalSignsField.class);
|
||||
if (annotation != null && annotation.name().equals(fieldName)) {
|
||||
return annotation.code();
|
||||
}
|
||||
}
|
||||
return "未知名称";
|
||||
}
|
||||
}
|
||||
|
||||
// 有效性检查
|
||||
private boolean isRecordValid(VitalSignSearchRecordDto record) {
|
||||
// 检查所有可能的属性
|
||||
return record.getSystolicPressure() != null || record.getDiastolicPressure() != null
|
||||
|| record.getTemperature() != null || record.getHeartRate() != null || record.getPulseRate() != null
|
||||
|| record.getBloodOxygen() != null || record.getBloodGlucose() != null
|
||||
|| record.getPhysicalCooling() != null || record.getCcuHeartRate() != null
|
||||
|| record.getNewbornsIncubator() != null || record.getBloodKetone() != null || record.getHeight() != null
|
||||
|| record.getWaistCircumference() != null || record.getStoolFrequency() != null
|
||||
|| record.getEnemaFrequency() != null || record.getSfAfterEnema() != null || record.getOutput() != null
|
||||
|| record.getInput() != null || record.getUrineVolume() != null || record.getStoolVolume() != null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.openhis.web.inpatientmanage.assembler;
|
||||
|
||||
public class AdmissionAssembler {}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.openhis.web.inpatientmanage.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.appservice.IAdmissionAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionSearchParam;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionUpDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/inpatient-manage")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class AdmissionController {
|
||||
|
||||
@Resource
|
||||
private IAdmissionAppService admissionAppService;
|
||||
|
||||
/**
|
||||
* 获取住院信息初期数据列表
|
||||
*
|
||||
* @return 住院信息初期数据列表
|
||||
*/
|
||||
@GetMapping("/init")
|
||||
public R<?> getAdmissionInfoInit() {
|
||||
return admissionAppService.getAdmissionInfoInit();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取住院信息 分页显示
|
||||
*
|
||||
* @param admissionSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院信息
|
||||
*/
|
||||
@GetMapping("/admission-page")
|
||||
R<?> getAdmissionInfoPage(AdmissionSearchParam admissionSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return admissionAppService.getAdmissionInfoPage(admissionSearchParam, searchKey, pageNo, pageSize, request);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院无档登记
|
||||
*
|
||||
* @param admissionUpDto 住院登记详细信息
|
||||
*/
|
||||
@PostMapping("/admission-information")
|
||||
public R<?> addAdmissionInfo(@Validated @RequestBody AdmissionUpDto admissionUpDto) {
|
||||
return admissionAppService.addAdmissionInfo(admissionUpDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登记
|
||||
*
|
||||
* @param admissionUpDto 住院登记详细信息
|
||||
*/
|
||||
@PutMapping("/admission-information")
|
||||
public R<?> editAdmissionInfo(@Validated @RequestBody AdmissionUpDto admissionUpDto) {
|
||||
// 调用服务层更新病人信息
|
||||
return admissionAppService.editAdmissionInfo(admissionUpDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询登记详情
|
||||
*
|
||||
* @param id 就诊ID
|
||||
* @return 登记详情
|
||||
*/
|
||||
@GetMapping("/admission-one")
|
||||
public R<?> getDeviceOne(@RequestParam Long id) {
|
||||
|
||||
return admissionAppService.getAdmissionOne(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.openhis.web.inpatientmanage.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.yb.dto.PaymentDto;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.appservice.IDepositAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.DepositSearchParam;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 预交金管理 controller
|
||||
*
|
||||
* @author gyy
|
||||
* @date 2025-05-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deposit-manage")
|
||||
@Slf4j
|
||||
public class DepositController {
|
||||
|
||||
@Resource
|
||||
private IDepositAppService depositAppService;
|
||||
|
||||
/**
|
||||
* 获取预交金信息初期数据列表
|
||||
*
|
||||
* @return 预交金初期数据列表
|
||||
*/
|
||||
@GetMapping("/init")
|
||||
public R<?> getDepositInfoInit() {
|
||||
return depositAppService.getDepositInfoInit();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预交金信息 分页显示
|
||||
*
|
||||
* @param depositSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院信息
|
||||
*/
|
||||
@GetMapping("/deposit-page")
|
||||
R<?> getDepositInfoPage(DepositSearchParam depositSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return depositAppService.getDepositInfoPage(depositSearchParam, searchKey, pageNo, pageSize, request);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 付款
|
||||
*
|
||||
* @param paymentDto 付款实体
|
||||
*/
|
||||
@PostMapping("/charge")
|
||||
public R<?> savePayment(@Validated @RequestBody PaymentDto paymentDto) {
|
||||
return depositAppService.savePayment(paymentDto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.openhis.web.inpatientmanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.appservice.INursingRecordAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingEmrTemplateDto;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingRecordDto;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingSearchParam;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 护理记录单 controller
|
||||
*
|
||||
* @author gyy
|
||||
* @date 2025-05-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nursing-record")
|
||||
@Slf4j
|
||||
public class NursingRecordController {
|
||||
|
||||
@Resource
|
||||
private INursingRecordAppService nursingRecordAppService;
|
||||
|
||||
/**
|
||||
* 获取住院患者信息 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者信息
|
||||
*/
|
||||
@GetMapping("/patient-page")
|
||||
public R<?> getPatientInfoPage(NursingSearchParam nursingSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return nursingRecordAppService.getPatientInfoPage(nursingSearchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者护理记录单信息 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者护理记录单信息
|
||||
*/
|
||||
@GetMapping("/nursing-patient-page")
|
||||
public R<?> getNursingPatientPage(NursingSearchParam nursingSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return nursingRecordAppService.getNursingPatientPage(nursingSearchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存护理记录单
|
||||
*
|
||||
* @param nursingRecordDto 护理记录实体
|
||||
*/
|
||||
@PostMapping("/save-nursing")
|
||||
public R<?> saveRecord(@Validated @RequestBody NursingRecordDto nursingRecordDto) {
|
||||
return nursingRecordAppService.saveRecord(nursingRecordDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑护理记录单
|
||||
*
|
||||
* @param nursingRecordDto 护理记录实体
|
||||
*/
|
||||
@PostMapping("/update-nursing")
|
||||
public R<?> updateRecord(@Validated @RequestBody NursingRecordDto nursingRecordDto) {
|
||||
return nursingRecordAppService.updateRecord(nursingRecordDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理记录单
|
||||
*
|
||||
* @param recordList 记录单List
|
||||
*/
|
||||
@PostMapping("/delete-nursing")
|
||||
public R<?> delRecord(@Validated @RequestBody List<NursingRecordDto> recordList) {
|
||||
return nursingRecordAppService.delRecord(recordList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子病历模板列表 分页显示
|
||||
*
|
||||
* @param nursingSearchParam 查询参数
|
||||
* @param searchKey 模糊查询
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 患者护理记录单信息
|
||||
*/
|
||||
@GetMapping("/emr-template-page")
|
||||
public R<?> getEmrTemplate(NursingSearchParam nursingSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return nursingRecordAppService.getEmrTemplate(nursingSearchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存病历模板
|
||||
*
|
||||
* @param emrTemplateDto 病历模板信息
|
||||
*/
|
||||
@PostMapping("/emr-template-save")
|
||||
public R<?> saveEmrTemplate(@Validated @RequestBody NursingEmrTemplateDto emrTemplateDto) {
|
||||
return nursingRecordAppService.saveEmrTemplate(emrTemplateDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除病历模板
|
||||
*
|
||||
* @param idList 模板id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/emr-template-del")
|
||||
public R<?> deleteEmrTemplate(@Validated @RequestBody List<Long> idList) {
|
||||
return nursingRecordAppService.deleteEmrTemplate(idList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑病历模板
|
||||
*
|
||||
* @param emrTemplateDto 病历模板信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/emr-template-update")
|
||||
public R<?> updateEmrTemplate(@Validated @RequestBody NursingEmrTemplateDto emrTemplateDto) {
|
||||
return nursingRecordAppService.updateEmrTemplate(emrTemplateDto);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.openhis.web.inpatientmanage.controller;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.appservice.IPatientHomeAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeSearchParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 患者首页 应用实现
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/patient-home-manage")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PatientHomeController {
|
||||
|
||||
@Resource
|
||||
private IPatientHomeAppService patientHomeAppService;
|
||||
|
||||
/**
|
||||
* 获取患者首页信息初期数据列表
|
||||
*
|
||||
* @return 患者首页初期数据列表
|
||||
*/
|
||||
@GetMapping("/init")
|
||||
public R<?> getPatientInfoInit(PatientHomeSearchParam patientHomeSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return patientHomeAppService.getPatientInfoInit(patientHomeSearchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者首页-病区的空病床信息
|
||||
*
|
||||
* @return 空病床列表
|
||||
*/
|
||||
@GetMapping("/empty-bed")
|
||||
public R<?> getEmptyBed(Long organizationId) {
|
||||
return patientHomeAppService.getEmptyBed(organizationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者首页-转床保存
|
||||
*
|
||||
* @return 转床结果
|
||||
*/
|
||||
@PutMapping("/bed-transfer")
|
||||
public R<?> saveBedTransfer(Long encounterLocationId, Long encounterId, Long oldLocationId, Long newLocationId) {
|
||||
return R
|
||||
.ok(patientHomeAppService.saveBedTransfer(encounterLocationId, encounterId, oldLocationId, newLocationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者首页-科室信息
|
||||
*
|
||||
* @return 科室列表
|
||||
*/
|
||||
@GetMapping("/caty")
|
||||
public R<?> getCaty() {
|
||||
return R.ok(patientHomeAppService.getCaty());
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者首页-转科保存
|
||||
*
|
||||
* @return 转科结果
|
||||
*/
|
||||
@PutMapping("/department-transfer")
|
||||
public R<?> saveDepartmentTransfer(Long encounterLocationId, Long patientId, Long encounterId, Long organizationId,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date DepartmentTransferYmd) {
|
||||
return R.ok(patientHomeAppService.saveDepartmentTransfer(encounterLocationId, patientId, encounterId,
|
||||
organizationId, DepartmentTransferYmd));
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者首页-出院信息
|
||||
*
|
||||
* @return 出院原因列表
|
||||
*/
|
||||
@PutMapping("/discharge-from-hospital")
|
||||
public R<?> saveDischargeHospital(Long encounterLocationId, Long patientId, Long encounterId, Long locationId,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date DischargeHospitalYmd) {
|
||||
return R.ok(patientHomeAppService.saveDischargeHospital(encounterLocationId, patientId, encounterId, locationId,
|
||||
DischargeHospitalYmd));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.openhis.web.inpatientmanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inpatientmanage.appservice.IVitalSignsAppService;
|
||||
import com.openhis.web.inpatientmanage.dto.VitalSignsDeleteDto;
|
||||
import com.openhis.web.inpatientmanage.dto.VitalSignsSaveDto;
|
||||
import com.openhis.web.inpatientmanage.dto.VitalSignsSearchParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 三测单 应用实现
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/vital-signs")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class VitalSignsController {
|
||||
|
||||
@Resource
|
||||
private IVitalSignsAppService vitalSignsAppService;
|
||||
|
||||
/**
|
||||
* 获取三测单-患者信息数据列表
|
||||
*
|
||||
* @return 患者信息数据列表
|
||||
*/
|
||||
@GetMapping("/patient-message")
|
||||
public R<?> getVitalSignsInfo(VitalSignsSearchParam vitalSignsSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "50") Integer pageSize, HttpServletRequest request) {
|
||||
return vitalSignsAppService.getVitalSignsInfo(vitalSignsSearchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 体温单记录保存
|
||||
*
|
||||
* @return 体温单记录保存结果
|
||||
*/
|
||||
@PutMapping("/record-saving")
|
||||
public R<?> saveVitalSigns(@RequestBody VitalSignsSaveDto vitalSignsSaveDto) {
|
||||
return R.ok(vitalSignsAppService.saveVitalSigns(vitalSignsSaveDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 体温单检索
|
||||
*
|
||||
* @return 体温单检索结果
|
||||
*/
|
||||
@GetMapping("/record-search")
|
||||
public R<?> searchVitalSigns(String startTime, String endTime) {
|
||||
return R.ok(vitalSignsAppService.searchVitalSigns(startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 体温单记录删除
|
||||
*
|
||||
* @return 体温单记录修改结果
|
||||
*/
|
||||
@PutMapping("/record-delete")
|
||||
public R<?> deleteVitalSigns(@RequestBody List<VitalSignsDeleteDto> vitalSignsDeleteDto) {
|
||||
return R.ok(vitalSignsAppService.deleteVitalSigns(vitalSignsDeleteDto));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 住院登记信息
|
||||
*
|
||||
* @author liuhr
|
||||
* @since 2025/04/07
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 患者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 群组ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long groupId;
|
||||
|
||||
/** 就诊编码 */
|
||||
private String encounterBusNo;
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 类别编码 */
|
||||
private Integer classEnum;
|
||||
|
||||
/** 类别医保编码 */
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/** 机构id(科室) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/** 入院类型 */
|
||||
@Dict(dictCode = "admit_source_code")
|
||||
private String admitSourceCode;
|
||||
private String admitSourceCode_dictText;
|
||||
|
||||
/** 入院方式 */
|
||||
@Dict(dictCode = "in_way_code")
|
||||
private String inWayCode;
|
||||
private String inWayCode_dictText;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String name;
|
||||
|
||||
/** 患者院内编码/病历号 */
|
||||
private String patientBusNo;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String ageString;
|
||||
|
||||
/** 身份证号 */
|
||||
private String idCard;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 入院病区 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long wardLocationId;
|
||||
private String wardLocationId_dictText;
|
||||
|
||||
/** 登记员 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 住院登记初始化页面信息
|
||||
*
|
||||
* @author liuhr
|
||||
* @since 2025/04/07
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionInitPageDto {
|
||||
|
||||
//获取入院类型列表
|
||||
private List<statusEnumOption> admissionTypeList;
|
||||
//获取入院方式列表
|
||||
private List<statusEnumOption> admissionMethodList;
|
||||
//优先级编码列表
|
||||
private List<statusEnumOption> priorityEnumList;
|
||||
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@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,17 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 住院登记查询参数
|
||||
*
|
||||
* @author liuhr
|
||||
* @since 2025/04/08
|
||||
*/
|
||||
@Data
|
||||
public class AdmissionSearchParam {
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.openhis.web.inpatientmanage.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;
|
||||
|
||||
/**
|
||||
* 住院登记信息
|
||||
*
|
||||
* @author liuhr
|
||||
* @since 2025/04/07
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionUpDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@NotNull(message = "就诊ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/** 患者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 群组ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long groupId;
|
||||
|
||||
/** 就诊编码 */
|
||||
private String encounterBusNo;
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 类别编码 */
|
||||
private Integer classEnum;
|
||||
|
||||
/** 类别医保编码 */
|
||||
private Integer ybClassEnum;
|
||||
private String ybClassEnum_enumText;
|
||||
|
||||
/** 优先级编码 */
|
||||
private Integer priorityEnum;
|
||||
private String priorityEnum_enumText;
|
||||
|
||||
/** 分类编码 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 服务ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceTypeId;
|
||||
|
||||
/** 就诊对象状态 */
|
||||
private Integer subjectStatusEnum;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/** 机构id(科室) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/** 入院类型 */
|
||||
@Dict(dictCode = "admit_source_code")
|
||||
private String admitSourceCode;
|
||||
private String admitSourceCode_dictText;
|
||||
|
||||
/** 入院方式 */
|
||||
@Dict(dictCode = "in_way_code")
|
||||
private String inWayCode;
|
||||
private String inWayCode_dictText;
|
||||
|
||||
/** 住院次数 */
|
||||
private Integer hospitalizationCount;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String name;
|
||||
|
||||
/** 患者院内编码/病历号 */
|
||||
private String patientBusNo;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 婚姻状态 */
|
||||
private Integer maritalStatusEnum;
|
||||
private String maritalStatusEnum_enumText;
|
||||
|
||||
/** 职业编码 */
|
||||
private Integer prfsEnum;
|
||||
private String prfsEnum_enumText;
|
||||
|
||||
/** 电话 */
|
||||
@Size(min = 11, max = 11, message = "电话长度必须为11位")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
|
||||
private String phone;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 民族 */
|
||||
private String nationalityCode;
|
||||
|
||||
/** 身份证号 */
|
||||
@NotBlank(message = "身份证号不能为空")
|
||||
@Size(min = 18, max = 18, message = "身份证号必须是18位")
|
||||
@Pattern(regexp = "^[0-9Xx]{18}$", message = "身份证号格式不正确")
|
||||
private String idCard;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 工作单位 */
|
||||
private String workCompany;
|
||||
|
||||
/** 籍贯 */
|
||||
private String nativePlace;
|
||||
|
||||
/** 国家编码 */
|
||||
private String countryCode;
|
||||
|
||||
/** 联系人 */
|
||||
private String linkName;
|
||||
|
||||
/** 联系人关系 */
|
||||
private Integer linkRelationCode;
|
||||
|
||||
/** 联系人电话 */
|
||||
@Size(min = 11, max = 11, message = "电话长度必须为11位")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
|
||||
private String linkTelcom;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String ageString;
|
||||
|
||||
/** 门诊诊断 */
|
||||
private String descriptions;
|
||||
|
||||
/** 接诊医生 */
|
||||
private String doctorName;
|
||||
|
||||
/** 入院病区 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long wardLocationId;
|
||||
private String wardLocationId_dictText;
|
||||
|
||||
/** 床位数 */
|
||||
private String bedCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 预交金信息
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DepositDetailDto {
|
||||
|
||||
/** 患者ID(住院号) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@NotNull(message = "住院号不能为空")
|
||||
private Long patientId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String name;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String ageString;
|
||||
|
||||
/** 床位号 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long bedLocationId;
|
||||
private String bedLocationId_dictText;
|
||||
|
||||
/** 机构id(科室) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/** 总额 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 预交金 */
|
||||
private BigDecimal deposit;
|
||||
|
||||
/** 余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 支付方式 */
|
||||
private String payWay;
|
||||
|
||||
/** 支付状态 */
|
||||
private Integer paymentEnum;
|
||||
private String paymentEnum_enumText;
|
||||
|
||||
/** 支付金额 */
|
||||
private BigDecimal tenderedAmount;
|
||||
|
||||
/** 收据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 票据状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 可退金额 */
|
||||
private BigDecimal afterBalance;
|
||||
|
||||
/** 收款时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date payTime;
|
||||
|
||||
/** 收款人 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name")
|
||||
private Long entererId;
|
||||
private String entererId_dictText;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 预交金管理初始化页面信息
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DepositInitPageDto {
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String admissionNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 预交金付款入参
|
||||
*
|
||||
* @author gaoyy
|
||||
* @date 2025-05-26
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DepositPaymentDto {
|
||||
|
||||
/** 支付的患者ID */
|
||||
@NotNull
|
||||
private Long patientId;
|
||||
|
||||
/** 付款总额 */
|
||||
private BigDecimal displayAmount;
|
||||
|
||||
/** 就诊ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 支付类型 */
|
||||
@NotNull
|
||||
private Integer payEnum;
|
||||
|
||||
/** 金额 */
|
||||
@NotNull
|
||||
private BigDecimal amount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 预交金管理查询参数
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Data
|
||||
public class DepositSearchParam {
|
||||
|
||||
/** 住院号 */
|
||||
private String admissionNo;
|
||||
|
||||
/** 在院病区 */
|
||||
private Long wardForm;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 住院患者信息
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class NursingDetailDto {
|
||||
|
||||
/** 就诊ID */
|
||||
@NotNull(message = "就诊ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 记录单ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long recordId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 患者生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 患者年龄 */
|
||||
private String ageString;
|
||||
|
||||
/** 记录人 */
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "adm_practitioner")
|
||||
private Long recorderId;
|
||||
private String recorderId_dictText;
|
||||
|
||||
/** 记录时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recordingTime;
|
||||
|
||||
/** 病历信息 */
|
||||
private String contextJson;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 入院日期 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date admissionDate;
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 床位号 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long bedLocationId;
|
||||
private String bedLocationId_dictText;
|
||||
|
||||
/** 病区 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long wardLocationId;
|
||||
private String wardLocationId_dictText;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 病历模板Dto
|
||||
*
|
||||
* @author gaoyy
|
||||
* @date 2025-06-06
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class NursingEmrTemplateDto implements Serializable {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 模板名称 */
|
||||
@NotBlank
|
||||
private String templateName;
|
||||
|
||||
/** 模板类型 */
|
||||
private String templateTypeCode;
|
||||
|
||||
/** 使用范围 */
|
||||
@NotBlank
|
||||
private String useScopeCode;
|
||||
|
||||
/** 使用范围文字 */
|
||||
private String useScopeCodeText;
|
||||
|
||||
/** 个人/科室ID */
|
||||
private Long userId;
|
||||
|
||||
/** 病历内容 */
|
||||
private String contextJson;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 住院患者信息
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class NursingPageDto {
|
||||
|
||||
/** 就诊ID */
|
||||
@NotNull(message = "就诊ID不能为空")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 病历号 */
|
||||
private String patientBusNo;
|
||||
|
||||
/** 患者生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 患者年龄 */
|
||||
private String ageString;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 入院日期 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date admissionDate;
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 床位号 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long bedLocationId;
|
||||
private String bedLocationId_dictText;
|
||||
|
||||
/** 病区 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long wardLocationId;
|
||||
private String wardLocationId_dictText;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 护理记录单入参
|
||||
*
|
||||
* @author gaoyy
|
||||
* @date 2025-05-30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class NursingRecordDto {
|
||||
|
||||
/** 记录单ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long recordId;
|
||||
|
||||
/** 就诊ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@NotNull
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 记录时间 */
|
||||
@NotNull
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recordingTime;
|
||||
|
||||
/** 病历信息 */
|
||||
private String contextJson;
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 是否同步到体温单 */
|
||||
private Boolean vitalSignsSyncFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 护理记录单查询参数
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/30
|
||||
*/
|
||||
@Data
|
||||
public class NursingSearchParam {
|
||||
|
||||
/** 在院病区 */
|
||||
private Long wardLocationId;
|
||||
|
||||
/** 床位号 */
|
||||
private Long bedLocationId;
|
||||
|
||||
/** 科室ID */
|
||||
private Long orgId;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 护理记录单s生命体征转换
|
||||
*
|
||||
* @author gaoyy
|
||||
* @date 2025-06-5
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class NursingVitalSignsDto {
|
||||
|
||||
// 体温
|
||||
private String tw;
|
||||
|
||||
// 脉搏
|
||||
private String mb;
|
||||
|
||||
// 呼吸
|
||||
private String hx;
|
||||
|
||||
// 无参构造函数
|
||||
public NursingVitalSignsDto() {}
|
||||
|
||||
// getters 和 setters
|
||||
public String getTw() {
|
||||
return tw;
|
||||
}
|
||||
|
||||
public void setTw(String tw) {
|
||||
this.tw = tw;
|
||||
}
|
||||
|
||||
// getters 和 setters
|
||||
public String getMb() {
|
||||
return mb;
|
||||
}
|
||||
|
||||
public void setMb(String mb) {
|
||||
this.mb = mb;
|
||||
}
|
||||
|
||||
// getters 和 setters
|
||||
public String getHx() {
|
||||
return hx;
|
||||
}
|
||||
|
||||
public void setHx(String hx) {
|
||||
this.hx = hx;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 患者首页信息
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientHomeDto {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 活动标记
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
|
||||
/**
|
||||
* 临时标识
|
||||
*/
|
||||
private Integer tempFlag;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 患者其他名称
|
||||
*/
|
||||
private String nameJson;
|
||||
|
||||
/**
|
||||
* 病历号
|
||||
*/
|
||||
private String patientNo;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String hospitalNo;
|
||||
|
||||
/**
|
||||
* 性别编码
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
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;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* 拼音码
|
||||
*/
|
||||
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_codeText;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
private String linkTelcom;
|
||||
|
||||
/**
|
||||
* 其他联系人
|
||||
*/
|
||||
private String linkJsons;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Integer tenanId;
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
private String encounterId;
|
||||
|
||||
/**
|
||||
* 病人年龄
|
||||
*/
|
||||
private String ageString;
|
||||
|
||||
/**
|
||||
* 护理级别
|
||||
*/
|
||||
private Integer priorityEnum;
|
||||
private String priorityEnum_enumText;
|
||||
|
||||
/**
|
||||
* 患者状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "adm_organization")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/**
|
||||
* 入院日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date admissionDate;
|
||||
|
||||
/**
|
||||
* 出院日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dischargeDate;
|
||||
|
||||
/**
|
||||
* 责任医生
|
||||
*/
|
||||
private String responsibleDoctor;
|
||||
|
||||
/**
|
||||
* 就诊位置ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private String encounterLocationId;
|
||||
|
||||
/**
|
||||
* 责任护士
|
||||
*/
|
||||
private String responsibleNurse;
|
||||
|
||||
/**
|
||||
* 主要诊断
|
||||
*/
|
||||
private String mainDiagnosis;
|
||||
|
||||
/**
|
||||
* 费别
|
||||
*/
|
||||
private Integer typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/**
|
||||
* 住院天数
|
||||
*/
|
||||
private Integer hospitalizationDays;
|
||||
|
||||
/**
|
||||
* 就诊类别
|
||||
*/
|
||||
private Integer classEnum;
|
||||
private String classEnum_enumText;
|
||||
|
||||
/**
|
||||
* 术后天数
|
||||
*/
|
||||
private Integer postoperativeDays;
|
||||
|
||||
/**
|
||||
* 手术开始日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date surgeryStartTime;
|
||||
|
||||
/**
|
||||
* 手术结束日期日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date surgeryEndTime;
|
||||
|
||||
/**
|
||||
* 手术状态
|
||||
*/
|
||||
private Integer surgeryStatusEnum;
|
||||
private String surgeryStatusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 过敏源类别
|
||||
*/
|
||||
@Dict(dictCode = "aise_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/**
|
||||
* 入院科室名称
|
||||
*/
|
||||
private String caty;
|
||||
|
||||
/**
|
||||
* 床位号
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 科室空床信息
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientHomeEmptyBedDto {
|
||||
|
||||
/**
|
||||
* 床位号
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 患者首页查询参数
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientHomeSearchParam {
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 患者ID */
|
||||
private Long patientId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VitalSignSearchRecordDto {
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private String recordingDate;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
private String timePoint;
|
||||
|
||||
/**
|
||||
* 体温
|
||||
*/
|
||||
@VitalSignsField(code = "001", name = "temperature", unit = "℃")
|
||||
private String temperature;
|
||||
|
||||
/**
|
||||
* 收缩压
|
||||
*/
|
||||
@VitalSignsField(code = "002", name = "systolicPressure", unit = "mmHg")
|
||||
private String systolicPressure;
|
||||
|
||||
/**
|
||||
* 舒张压
|
||||
*/
|
||||
@VitalSignsField(code = "003", name = "diastolicPressure", unit = "mmHg")
|
||||
private String diastolicPressure;
|
||||
|
||||
/**
|
||||
* 心率
|
||||
*/
|
||||
@VitalSignsField(code = "004", name = "heartRate", unit = "次/分")
|
||||
private String heartRate;
|
||||
|
||||
/**
|
||||
* 脉搏
|
||||
*/
|
||||
@VitalSignsField(code = "005", name = "pulseRate", unit = "次/分")
|
||||
private String pulseRate;
|
||||
|
||||
/**
|
||||
* 呼吸
|
||||
*/
|
||||
@VitalSignsField(code = "006", name = "respirationRate", unit = "次/分")
|
||||
private String respirationRate;
|
||||
|
||||
/**
|
||||
* 血氧
|
||||
*/
|
||||
@VitalSignsField(code = "007", name = "bloodOxygen", unit = "%")
|
||||
private String bloodOxygen;
|
||||
|
||||
/**
|
||||
* 血糖
|
||||
*/
|
||||
@VitalSignsField(code = "008", name = "bloodGlucose", unit = "mmol/L")
|
||||
private String bloodGlucose;
|
||||
|
||||
/**
|
||||
* 物理降温
|
||||
*/
|
||||
@VitalSignsField(code = "009", name = "physicalCooling", unit = "℃")
|
||||
private String physicalCooling;
|
||||
|
||||
/**
|
||||
* CCU心率
|
||||
*/
|
||||
@VitalSignsField(code = "010", name = "ccuHeartRate", unit = "bpm")
|
||||
private String ccuHeartRate;
|
||||
|
||||
/**
|
||||
* 新生儿箱温
|
||||
*/
|
||||
@VitalSignsField(code = "011", name = "newbornsIncubator", unit = "℃")
|
||||
private String newbornsIncubator;
|
||||
|
||||
/**
|
||||
* 血酮
|
||||
*/
|
||||
@VitalSignsField(code = "012", name = "bloodKetone", unit = "mmol/L")
|
||||
private String bloodKetone;
|
||||
|
||||
/**
|
||||
* 身高
|
||||
*/
|
||||
@VitalSignsField(code = "013", name = "height", unit = "cm")
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 腹围
|
||||
*/
|
||||
@VitalSignsField(code = "014", name = "waistCircumference", unit = "cm")
|
||||
private String waistCircumference;
|
||||
|
||||
/**
|
||||
* 大便次数
|
||||
*/
|
||||
@VitalSignsField(code = "015", name = "stoolFrequency", unit = "次/天")
|
||||
private String stoolFrequency;
|
||||
|
||||
/**
|
||||
* 灌肠次数
|
||||
*/
|
||||
@VitalSignsField(code = "016", name = "enemaFrequency", unit = "次/天")
|
||||
private String enemaFrequency;
|
||||
|
||||
/**
|
||||
* 灌肠后大便次数
|
||||
*/
|
||||
@VitalSignsField(code = "017", name = "sfAfterEnema", unit = "次/天")
|
||||
private String sfAfterEnema;
|
||||
|
||||
/**
|
||||
* 出量
|
||||
*/
|
||||
@VitalSignsField(code = "018", name = "output", unit = "mL")
|
||||
private String output;
|
||||
|
||||
/**
|
||||
* 入量
|
||||
*/
|
||||
@VitalSignsField(code = "019", name = "input", unit = "mL")
|
||||
private String input;
|
||||
|
||||
/**
|
||||
* 尿量
|
||||
*/
|
||||
@VitalSignsField(code = "020", name = "urineVolume", unit = "mL")
|
||||
private String urineVolume;
|
||||
|
||||
/**
|
||||
* 大便量
|
||||
*/
|
||||
@VitalSignsField(code = "021", name = "stoolVolume", unit = "g")
|
||||
private String stoolVolume;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 三测单信息
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class VitalSignsChartSmallDto {
|
||||
|
||||
private Integer collectionMode;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private String date;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
private String times;
|
||||
|
||||
/**
|
||||
* 生命体征编码
|
||||
*/
|
||||
private String typeCode;
|
||||
|
||||
/**
|
||||
* 生命体征值
|
||||
*/
|
||||
private String typeValue;
|
||||
|
||||
/**
|
||||
* 术后天数
|
||||
*/
|
||||
private Integer postoperativeDays;
|
||||
|
||||
/**
|
||||
* 周数
|
||||
*/
|
||||
private Integer weekNo;
|
||||
private String orderByDateTimes;
|
||||
private String id;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生命体征管理
|
||||
*
|
||||
* @author SY
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class VitalSignsDeleteDto extends HisBaseEntity {
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private String recordingDate;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
private String timePoint;
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 三测单信息
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class VitalSignsDto {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 患者ID
|
||||
*/
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date recordingDate;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date timePoint;
|
||||
|
||||
/**
|
||||
* 生命体征编码
|
||||
*/
|
||||
private String vitalSignsCode;
|
||||
|
||||
/**
|
||||
* 生命体征值
|
||||
*/
|
||||
private String vitalSignsValues;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String units;
|
||||
|
||||
/**
|
||||
* 婴儿编号
|
||||
*/
|
||||
private Integer babyNo;
|
||||
|
||||
/**
|
||||
* 科室编码
|
||||
*/
|
||||
private Integer locationId;
|
||||
|
||||
/**
|
||||
* 记录人员
|
||||
*/
|
||||
private String recorder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remake;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "adm_organization")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
/**
|
||||
* 床位号
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
private Long bedLocationId;
|
||||
private String bedLocationId_dictText;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String hospitalNo;
|
||||
|
||||
/**
|
||||
* 入院日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date admissionDate;
|
||||
|
||||
/**
|
||||
* 出院日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dischargeDate;
|
||||
|
||||
/**
|
||||
* 住院天数
|
||||
*/
|
||||
private Integer hospitalizationDays;
|
||||
|
||||
/**
|
||||
* 手术开始日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date surgeryStartTime;
|
||||
|
||||
/**
|
||||
* 手术结束日期日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date surgeryEndTime;
|
||||
|
||||
/**
|
||||
* 手术状态
|
||||
*/
|
||||
private Integer surgeryStatusEnum;
|
||||
private String surgeryStatusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 术后天数
|
||||
*/
|
||||
private Integer postoperativeDays;
|
||||
|
||||
/**
|
||||
* 就诊类别
|
||||
*/
|
||||
private Integer classEnum;
|
||||
private String classEnum_enumText;
|
||||
|
||||
/**
|
||||
* 周数
|
||||
*/
|
||||
private Integer weekNo;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface VitalSignsField {
|
||||
String code(); // 生命体征代码
|
||||
|
||||
String name(); // 生命体征名称
|
||||
|
||||
String unit();// 单位(可选)
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 三测单信息
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class VitalSignsMedicalRecordDto {
|
||||
|
||||
/**
|
||||
* 入院日期
|
||||
*/
|
||||
private Date hospDate;
|
||||
|
||||
/**
|
||||
* 手术日期
|
||||
*/
|
||||
private String operaDate;
|
||||
|
||||
/**
|
||||
* 出院日期
|
||||
*/
|
||||
private String outdate;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private List<VitalSignsTemperaturePulsesDto> temperaturePulses;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private List<Object> others;
|
||||
|
||||
public VitalSignsMedicalRecordDto() {
|
||||
this.temperaturePulses = new ArrayList<>();
|
||||
this.others = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生命体征管理
|
||||
*
|
||||
* @author SY
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VitalSignsSaveDto extends HisBaseEntity {
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private Date recordingDate;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
private String timePoint;
|
||||
|
||||
/**
|
||||
* 体温
|
||||
*/
|
||||
@VitalSignsField(code = "001", name = "temperature", unit = "℃")
|
||||
private String temperature;
|
||||
|
||||
/**
|
||||
* 收缩压
|
||||
*/
|
||||
@VitalSignsField(code = "002", name = "systolicPressure", unit = "mmHg")
|
||||
private String systolicPressure;
|
||||
|
||||
/**
|
||||
* 舒张压
|
||||
*/
|
||||
@VitalSignsField(code = "003", name = "diastolicPressure", unit = "mmHg")
|
||||
private String diastolicPressure;
|
||||
|
||||
/**
|
||||
* 心率
|
||||
*/
|
||||
@VitalSignsField(code = "004", name = "heartRate", unit = "次/分")
|
||||
private String heartRate;
|
||||
|
||||
/**
|
||||
* 脉搏
|
||||
*/
|
||||
@VitalSignsField(code = "005", name = "pulseRate", unit = "次/分")
|
||||
private String pulseRate;
|
||||
|
||||
/**
|
||||
* 呼吸
|
||||
*/
|
||||
@VitalSignsField(code = "006", name = "respirationRate", unit = "次/分")
|
||||
private String respirationRate;
|
||||
|
||||
/**
|
||||
* 血氧
|
||||
*/
|
||||
@VitalSignsField(code = "007", name = "bloodOxygen", unit = "%")
|
||||
private String bloodOxygen;
|
||||
|
||||
/**
|
||||
* 血糖
|
||||
*/
|
||||
@VitalSignsField(code = "008", name = "bloodGlucose", unit = "mmol/L")
|
||||
private String bloodGlucose;
|
||||
|
||||
/**
|
||||
* 物理降温
|
||||
*/
|
||||
@VitalSignsField(code = "009", name = "physicalCooling", unit = "℃")
|
||||
private String physicalCooling;
|
||||
|
||||
/**
|
||||
* CCU心率
|
||||
*/
|
||||
@VitalSignsField(code = "010", name = "ccuHeartRate", unit = "bpm")
|
||||
private String ccuHeartRate;
|
||||
|
||||
/**
|
||||
* 新生儿箱温
|
||||
*/
|
||||
@VitalSignsField(code = "011", name = "newbornsIncubator", unit = "℃")
|
||||
private String newbornsIncubator;
|
||||
|
||||
/**
|
||||
* 血酮
|
||||
*/
|
||||
@VitalSignsField(code = "012", name = "bloodKetone", unit = "mmol/L")
|
||||
private String bloodKetone;
|
||||
|
||||
/**
|
||||
* 身高
|
||||
*/
|
||||
@VitalSignsField(code = "013", name = "height", unit = "cm")
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 腹围
|
||||
*/
|
||||
@VitalSignsField(code = "014", name = "waistCircumference", unit = "cm")
|
||||
private String waistCircumference;
|
||||
|
||||
/**
|
||||
* 大便次数
|
||||
*/
|
||||
@VitalSignsField(code = "015", name = "stoolFrequency", unit = "次/天")
|
||||
private String stoolFrequency;
|
||||
|
||||
/**
|
||||
* 灌肠次数
|
||||
*/
|
||||
@VitalSignsField(code = "016", name = "enemaFrequency", unit = "次/天")
|
||||
private String enemaFrequency;
|
||||
|
||||
/**
|
||||
* 灌肠后大便次数
|
||||
*/
|
||||
@VitalSignsField(code = "017", name = "sfAfterEnema", unit = "次/天")
|
||||
private String sfAfterEnema;
|
||||
|
||||
/**
|
||||
* 出量
|
||||
*/
|
||||
@VitalSignsField(code = "018", name = "output", unit = "mL")
|
||||
private String output;
|
||||
|
||||
/**
|
||||
* 入量
|
||||
*/
|
||||
@VitalSignsField(code = "019", name = "input", unit = "mL")
|
||||
private String input;
|
||||
|
||||
/**
|
||||
* 尿量
|
||||
*/
|
||||
@VitalSignsField(code = "020", name = "urineVolume", unit = "mL")
|
||||
private String urineVolume;
|
||||
|
||||
/**
|
||||
* 大便量
|
||||
*/
|
||||
@VitalSignsField(code = "021", name = "stoolVolume", unit = "g")
|
||||
private String stoolVolume;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String units;
|
||||
|
||||
/**
|
||||
* 婴儿编号
|
||||
*/
|
||||
private Integer babyNo;
|
||||
|
||||
/**
|
||||
* 科室编码
|
||||
*/
|
||||
private Integer locationId;
|
||||
|
||||
/**
|
||||
* 记录人员
|
||||
*/
|
||||
private String recorder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remake;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 三测单查询参数
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class VitalSignsSearchParam {
|
||||
|
||||
/** 患者ID */
|
||||
private Long patientId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 三测单信息
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class VitalSignsTemperaturePulsesDto {
|
||||
|
||||
/**
|
||||
* 生命体征明细
|
||||
*/
|
||||
private List<VitalSignsChartSmallDto> chartsSmalls;
|
||||
|
||||
/**
|
||||
* 周数
|
||||
*/
|
||||
private Integer weekNo;
|
||||
|
||||
// 构造函数、getter和setter方法
|
||||
public VitalSignsTemperaturePulsesDto() {
|
||||
this.chartsSmalls = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.openhis.web.inpatientmanage.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.inpatientmanage.dto.AdmissionDto;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionUpDto;
|
||||
|
||||
/**
|
||||
* 住院登记
|
||||
*
|
||||
* @author liuhr
|
||||
* @since 2025/04/08
|
||||
*/
|
||||
@Repository
|
||||
public interface AdmissionMapper {
|
||||
|
||||
/**
|
||||
* 住院登记信息分页查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param classEnum 类别编码(1:住院类型)
|
||||
* @param formEnum 类别编码(1:住院类型)
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 住院登记信息
|
||||
*/
|
||||
IPage<AdmissionDto> getPage(@Param("page") Page<AdmissionDto> page, @Param("classEnum") Integer classEnum,
|
||||
@Param("formEnum") Integer formEnum, @Param(Constants.WRAPPER) QueryWrapper<AdmissionDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 住院登记详情
|
||||
*
|
||||
* @param classEnum 类别编码(1:住院类型)
|
||||
* @param statusEnum 状态编码(4:出院状态)
|
||||
* @param bedForm 床:8
|
||||
* @param wardForm 病区:4
|
||||
* @param operational 床位状态(4:占用)
|
||||
* @param typeCode 就诊参与者身份类型 (1:接诊医生)
|
||||
* @param id 就诊ID
|
||||
* @param tenantId 租户
|
||||
* @return 住院登记详情
|
||||
*/
|
||||
AdmissionUpDto getAdmissionOne(@Param("classEnum") Integer classEnum, @Param("statusEnum") Integer statusEnum,
|
||||
@Param("bedForm") Integer bedForm, @Param("wardForm") Integer wardForm, @Param("typeCode") String typeCode,
|
||||
@Param("operational") Integer operational, @Param("id") Long id, @Param("tenantId") Integer tenantId);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.openhis.web.inpatientmanage.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.inpatientmanage.dto.DepositDetailDto;
|
||||
|
||||
/**
|
||||
* 预交金管理
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/20
|
||||
*/
|
||||
@Repository
|
||||
public interface DepositMapper {
|
||||
|
||||
/**
|
||||
* 预交金信息分页查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param classEnum 类别编码(住院)
|
||||
* @param formEnum 类别编码(床)
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 预交金信息
|
||||
*/
|
||||
IPage<DepositDetailDto> getPage(@Param("page") Page<DepositDetailDto> page, @Param("classEnum") Integer classEnum,
|
||||
@Param("formEnum") Integer formEnum, @Param(Constants.WRAPPER) QueryWrapper<DepositDetailDto> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.openhis.web.inpatientmanage.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.inpatientmanage.dto.NursingDetailDto;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingEmrTemplateDto;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingPageDto;
|
||||
import com.openhis.web.inpatientmanage.dto.NursingSearchParam;
|
||||
|
||||
/**
|
||||
* 护理记录单
|
||||
*
|
||||
* @author gaoyy
|
||||
* @since 2025/05/30
|
||||
*/
|
||||
@Repository
|
||||
public interface NursingRecordAppMapper {
|
||||
|
||||
/**
|
||||
* 住院患者信息分页查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param classEnum 类别编码(住院)
|
||||
* @param bed 类别编码(床)
|
||||
* @param ward 类别编码(病区)
|
||||
* @param active 状态(正在用)
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 患者信息
|
||||
*/
|
||||
IPage<NursingPageDto> getPatientPage(@Param("page") Page<NursingPageDto> page,
|
||||
@Param("classEnum") Integer classEnum, @Param("bed") Integer bed, @Param("ward") Integer ward,
|
||||
@Param("active") Integer active, @Param(Constants.WRAPPER) QueryWrapper<NursingSearchParam> queryWrapper);
|
||||
|
||||
/**
|
||||
* 患者护理记录单信息分页查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param classEnum 类别编码(住院)
|
||||
* @param bed 类别编码(床)
|
||||
* @param ward 类别编码(病区)
|
||||
* @param active 状态(正在用)
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 患者护理记录单信息
|
||||
*/
|
||||
IPage<NursingDetailDto> getNursingPatientPage(@Param("page") Page<NursingDetailDto> page,
|
||||
@Param("classEnum") Integer classEnum, @Param("bed") Integer bed, @Param("ward") Integer ward,
|
||||
@Param("active") Integer active, @Param(Constants.WRAPPER) QueryWrapper<NursingSearchParam> queryWrapper);
|
||||
|
||||
/**
|
||||
* 电子病历模板列表信息分页查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param nursing 护理单
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 电子病历模板列表信息
|
||||
*/
|
||||
IPage<NursingEmrTemplateDto> getEmrTemplate(@Param("page") Page<NursingDetailDto> page,
|
||||
@Param("nursing") String nursing, @Param(Constants.WRAPPER) QueryWrapper<NursingSearchParam> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.openhis.web.inpatientmanage.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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeDto;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeEmptyBedDto;
|
||||
|
||||
/**
|
||||
* 患者首页
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/19
|
||||
*/
|
||||
@Repository
|
||||
public interface PatientHomeAppMapper {
|
||||
|
||||
/**
|
||||
* 患者首页信息分页查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param statusEnum 状态编码
|
||||
* @param patientId 患者ID
|
||||
* @param searchKey 查询条件
|
||||
* @return 住院登记信息
|
||||
*/
|
||||
IPage<PatientHomeDto> getPage(@Param("page") Page<PatientHomeDto> page, @Param("statusEnum") Integer statusEnum,
|
||||
@Param("patientId") Long patientId, @Param("searchKey") String searchKey,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PatientHomeDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 空床查询
|
||||
*
|
||||
* @param organizationId 查询条件
|
||||
* @return 空床查询结果
|
||||
*/
|
||||
List<PatientHomeEmptyBedDto> getEmptyBedList(@Param("organizationId") Long organizationId);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.openhis.web.inpatientmanage.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.document.domain.VitalSigns;
|
||||
import com.openhis.web.inpatientmanage.dto.PatientHomeDto;
|
||||
import com.openhis.web.inpatientmanage.dto.VitalSignsDto;
|
||||
|
||||
/**
|
||||
* 三测单
|
||||
*
|
||||
* @author SY
|
||||
* @since 2025/05/29
|
||||
*/
|
||||
@Repository
|
||||
public interface VitalSignsAppMapper {
|
||||
|
||||
/**
|
||||
* 三测单查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param patientId 患者ID
|
||||
* @param searchKey 查询条件
|
||||
* @return 三测单信息
|
||||
*/
|
||||
IPage<VitalSignsDto> getVitalSignsInfo(@Param("page") Page<PatientHomeDto> page, @Param("patientId") Long patientId,
|
||||
@Param("searchKey") String searchKey, @Param(Constants.WRAPPER) QueryWrapper<VitalSignsDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询记录
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 查询记录结果
|
||||
*/
|
||||
List<VitalSigns> searchVitalSigns(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param patientId 患者ID
|
||||
* @param encounterId 就诊ID
|
||||
* @param recordingDate 记录日期
|
||||
* @param timePoint 记录时间
|
||||
* @return 查询记录结果
|
||||
*/
|
||||
boolean deleteVitalSigns(@Param("patientId") Long patientId, @Param("encounterId") Long encounterId,
|
||||
@Param("recordingDate") Date recordingDate, @Param("timePoint") Date timePoint);
|
||||
}
|
||||
Reference in New Issue
Block a user