|
@@ -10,14 +10,14 @@ import org.jeecg.modules.medical.common.bo.after.response.AfterwardsAuditDetailR
|
|
|
import org.jeecg.modules.medical.common.bo.before.AuditAdvanceWarningAuditDetailResponse;
|
|
|
import org.jeecg.modules.medical.common.bo.before.PatientInformationResponse;
|
|
|
import org.jeecg.modules.medical.common.bo.mid.response.MidAuditViolateProjectStatisticsResponse;
|
|
|
-import org.jeecg.modules.medical.entity.AfterwardsAudit;
|
|
|
-import org.jeecg.modules.medical.entity.AfterwardsAuditDetail;
|
|
|
-import org.jeecg.modules.medical.entity.MidIncidentAudit;
|
|
|
-import org.jeecg.modules.medical.entity.MidIncidentAuditDetail;
|
|
|
+import org.jeecg.modules.medical.entity.*;
|
|
|
import org.jeecg.modules.medical.mapper.AfterwardsAuditDetailMapper;
|
|
|
+import org.jeecg.modules.medical.service.IAdvanceWarningAuditDetailService;
|
|
|
+import org.jeecg.modules.medical.service.IAdvanceWarningAuditService;
|
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditDetailService;
|
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -40,6 +40,11 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class AfterwardsAuditDetailServiceImpl extends ServiceImpl<AfterwardsAuditDetailMapper, AfterwardsAuditDetail> implements IAfterwardsAuditDetailService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IAdvanceWarningAuditService advanceWarningAuditService;
|
|
|
+ @Autowired
|
|
|
+
|
|
|
+ private IAdvanceWarningAuditDetailService advanceWarningAuditDetailService;
|
|
|
@Override
|
|
|
public AfterwardsAuditDetailResponse afterAllDetail(Integer detailId) {
|
|
|
AfterwardsAuditDetail one = getById(detailId);
|
|
@@ -80,6 +85,38 @@ public class AfterwardsAuditDetailServiceImpl extends ServiceImpl<AfterwardsAudi
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public PatientInformationResponse beforeLoadPatientInfoById(Integer auditId, IAdvanceWarningAuditService advanceWarningAuditService) {
|
|
|
+ AdvanceWarningAudit afterwardsAudit = advanceWarningAuditService.getById(auditId);
|
|
|
+ if (afterwardsAudit == null) {
|
|
|
+ log.error("找不到事前工单id={}", auditId);
|
|
|
+ throw new JeecgBootException("找不到工单id");
|
|
|
+ }
|
|
|
+ PatientInformationResponse result = baseMapper.beforeLoadPatientInfoById(auditId);
|
|
|
+ if (null != result) {
|
|
|
+ //查一次就诊流水号
|
|
|
+ List<AdvanceWarningAuditDetail> detailList = beforeLoadDetailList(auditId);//baseMapper.loadAdvanceWarningAuditDetail(id);
|
|
|
+ if (!CollectionUtils.isEmpty(detailList)) {
|
|
|
+ AdvanceWarningAuditDetail advanceWarningAuditDetail = detailList.get(0);
|
|
|
+ String outpatientNumber = advanceWarningAuditDetail.getOutpatientNumber();
|
|
|
+ result.setVisitSerialNumber(outpatientNumber);
|
|
|
+ result.setMedicalInsurance(advanceWarningAuditDetail.getMedicalInsuranceMark());
|
|
|
+ }
|
|
|
+ //计算患者年龄
|
|
|
+ Date birthday = result.getBirthday();
|
|
|
+ if (null != birthday) {
|
|
|
+
|
|
|
+ Instant instant = birthday.toInstant();
|
|
|
+ LocalDate usageLocalDate = instant.atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
+ LocalDate now = LocalDate.now();
|
|
|
+ // 获取两个日期天数相差
|
|
|
+ long until = usageLocalDate.until(now, ChronoUnit.YEARS) + 1;
|
|
|
+ result.setAge(String.valueOf(until));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<MidAuditViolateProjectStatisticsResponse> afterViolateProjectStatisticsList(IPage<AuditAdvanceWarningAuditDetailResponse> page, String projectCode, String medicalProjectSearch, String startTime, String endTime) {
|
|
|
return baseMapper.afterViolateProjectStatisticsList(page, projectCode, medicalProjectSearch, startTime, endTime);
|
|
@@ -90,4 +127,9 @@ public class AfterwardsAuditDetailServiceImpl extends ServiceImpl<AfterwardsAudi
|
|
|
.eq(AfterwardsAuditDetail::getAfterwardsAuditId, id);
|
|
|
return this.list(queryWrapper);
|
|
|
}
|
|
|
+ private List<AdvanceWarningAuditDetail> beforeLoadDetailList(Integer id) {
|
|
|
+ LambdaQueryWrapper<AdvanceWarningAuditDetail> queryWrapper = Wrappers.<AdvanceWarningAuditDetail>lambdaQuery()
|
|
|
+ .eq(AdvanceWarningAuditDetail::getAdvanceWarningAuditId, id);
|
|
|
+ return advanceWarningAuditDetailService.list(queryWrapper);
|
|
|
+ }
|
|
|
}
|