|
|
@@ -2,6 +2,7 @@ package cn.tr.module.phototherapy.common.service.impl;
|
|
|
|
|
|
import cn.tr.module.phototherapy.common.dto.BusPatientListQueryDTO;
|
|
|
import cn.tr.module.phototherapy.common.dto.PatientTherapyDetailDTO;
|
|
|
+import cn.tr.module.phototherapy.common.mapper.BusTherapyRecordMapper;
|
|
|
import cn.tr.module.phototherapy.common.vo.PatientTherapyDetailVO;
|
|
|
import cn.tr.module.phototherapy.common.vo.PatientTherapyRecordVO;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
@@ -116,55 +117,14 @@ public class BusClinicServiceImpl extends ServiceImpl<BusClinicRepository, BusCl
|
|
|
* @date 2026-01-20
|
|
|
**/
|
|
|
@Override
|
|
|
- public PatientTherapyDetailDTO getPatientTherapyDetailById(String patientUniqueId) {
|
|
|
+ public PatientTherapyDetailVO getPatientTherapyDetailById(String patientUniqueId) {
|
|
|
// 通过多表联查获取数据
|
|
|
- PatientTherapyDetailVO detailVO = busClinicRepository.selectPatientTherapyDetailById(patientUniqueId);
|
|
|
+ PatientTherapyDetailDTO detailDTO = busClinicRepository.selectPatientTherapyDetailById(patientUniqueId);
|
|
|
|
|
|
- if (detailVO == null) {
|
|
|
+ if (detailDTO == null) {
|
|
|
throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "患者临床信息不存在");
|
|
|
}
|
|
|
|
|
|
- // 转换为 DTO 并进行必要的业务逻辑处理
|
|
|
- PatientTherapyDetailDTO detailDTO = new PatientTherapyDetailDTO();
|
|
|
-
|
|
|
- // 基本信息直接复制
|
|
|
- detailDTO.setPatientName(detailVO.getPatientName());
|
|
|
- detailDTO.setPatientAge(detailVO.getPatientAge());
|
|
|
- detailDTO.setPatientGender(detailVO.getPatientGender());
|
|
|
- detailDTO.setPatientUniqueId(detailVO.getPatientUniqueId());
|
|
|
- detailDTO.setPatientPhone(detailVO.getPatientPhone());
|
|
|
- detailDTO.setPatientAddress(detailVO.getPatientAddress());
|
|
|
- detailDTO.setLastTreatmentTime(detailVO.getLastTreatmentTime());
|
|
|
- detailDTO.setGroupType(detailVO.getGroupType());
|
|
|
- detailDTO.setTherapyCount(detailVO.getTherapyCount());
|
|
|
- detailDTO.setTherapyStatus(String.valueOf(detailVO.getTherapyStatus())); // 转换为字符串
|
|
|
- detailDTO.setStartTime(detailVO.getStartTime());
|
|
|
- detailDTO.setPhaseType(detailVO.getPhaseType());
|
|
|
-
|
|
|
- // 拼接治疗方案
|
|
|
- StringBuilder therapyPlan = new StringBuilder();
|
|
|
- if (detailVO.getPhaseFreq() != null && !detailVO.getPhaseFreq().trim().isEmpty()) {
|
|
|
- therapyPlan.append(detailVO.getPhaseFreq());
|
|
|
- }
|
|
|
- if (detailVO.getPhaseDurationMin() != null) {
|
|
|
- if (therapyPlan.length() > 0) {
|
|
|
- therapyPlan.append("; ");
|
|
|
- }
|
|
|
- therapyPlan.append("每次").append(detailVO.getPhaseDurationMin()).append("min");
|
|
|
- }
|
|
|
- detailDTO.setTherapyPlan(therapyPlan.toString());
|
|
|
-
|
|
|
- detailDTO.setPlanDoctor(detailVO.getPlanDoctor());
|
|
|
-
|
|
|
- // 设备信息处理 - 根据当前绑定状态决定是否显示设备
|
|
|
- if (detailVO.getDeviceId() != null &&
|
|
|
- detailVO.getBindStartTime() != null) {
|
|
|
- detailDTO.setDeviceId(detailVO.getDeviceId());
|
|
|
- detailDTO.setBindStartTime(detailVO.getBindStartTime());
|
|
|
- } else {
|
|
|
- detailDTO.setDeviceId(null);
|
|
|
- }
|
|
|
-
|
|
|
- return detailDTO;
|
|
|
+ return BusClinicMapper.INSTANCE.convertPatientTherapyDetailVO(detailDTO);
|
|
|
}
|
|
|
}
|