|
|
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.lang.Snowflake; |
|
|
|
import cn.hutool.core.util.IdcardUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.ccsens.ht.bean.dto.PatientReportDto; |
|
|
|
import com.ccsens.ht.bean.po.*; |
|
|
@ -217,11 +218,16 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
//查询报告单信息和病人信息
|
|
|
|
PatientReportVo.ReprotPatient reportPatient = htPatientReportDao.queryReportResult(queryDetail.getId()); |
|
|
|
//查询报告单分数
|
|
|
|
List<PatientReportVo.ReportScore> reportScore = htPatientReportDao.queryReportScore(queryDetail.getId()); |
|
|
|
List<PatientReportVo.ReportScore> reportScore = htPatientReportDao.queryReportScore(queryDetail.getId(),queryDetail.getRey()); |
|
|
|
//重新封装报告单信息
|
|
|
|
Map<String, PatientReportVo.ReportScore> map = new HashMap<>(32); |
|
|
|
List<PatientReportVo.ReportScore> scores = new ArrayList<>(); |
|
|
|
reportScore.forEach(score -> { |
|
|
|
if(ObjectUtil.isNotNull(score.getScore())){ |
|
|
|
if(BigDecimal.valueOf(score.getScore().intValue()).compareTo(score.getScore()) == 0){ |
|
|
|
score.setScore(score.getScore().setScale(0,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put(score.getCode(), score); |
|
|
|
//测评类(MOCA等)
|
|
|
|
if (Constant.Ht.Report.TYPE_EVALUATION.equals(score.getType())) { |
|
|
@ -231,6 +237,7 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
} |
|
|
|
scores.add(score); |
|
|
|
} else { |
|
|
|
|
|
|
|
log.info("score:{}", score); |
|
|
|
map.get(score.getParentCode()).addSub(score); |
|
|
|
} |
|
|
@ -258,7 +265,10 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
carer.setCode("carer"); |
|
|
|
carer.setName("照顾者"); |
|
|
|
carer.setTotalScore(-1); |
|
|
|
carer.setScore(npiScore == null || npiScore.get("carer") == null ? null : ((BigDecimal) npiScore.get("carer"))); |
|
|
|
carer.setScore(npiScore == null || npiScore.get("carer") == null ? null : ((BigDecimal)npiScore.get("carer"))); |
|
|
|
if(ObjectUtil.isNotNull(carer.getScore())){ |
|
|
|
carer.setScore(carer.getScore().setScale(0,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
carer.setType((byte)3); |
|
|
|
carer.setParentCode("NPI"); |
|
|
|
score.addSub(carer); |
|
|
@ -267,6 +277,9 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
patient.setName("患者"); |
|
|
|
patient.setTotalScore(-1); |
|
|
|
patient.setScore(npiScore == null || npiScore.get("result") == null ? null : ((BigDecimal) npiScore.get("result"))); |
|
|
|
if(ObjectUtil.isNotNull(patient.getScore())){ |
|
|
|
patient.setScore(patient.getScore().setScale(0,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
patient.setType((byte)3); |
|
|
|
patient.setParentCode("NPI"); |
|
|
|
score.addSub(patient); |
|
|
@ -354,6 +367,8 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
@Override |
|
|
|
public String exportReport(PatientReportDto.QueryDetail queryDetail, Long userId) { |
|
|
|
log.info("导出报告单:{}, 操作用户:{}", queryDetail, userId); |
|
|
|
// TODO 暂时不导出rey试题,将传入参数改为1
|
|
|
|
queryDetail.setRey(1); |
|
|
|
//查看是否已生成对应文件路径
|
|
|
|
HtPatientReport report = htPatientReportDao.selectByPrimaryKey(queryDetail.getId()); |
|
|
|
if (report == null) { |
|
|
|