From 52867a81210d8f84ba9d6e1fdb6d1e22dffe292e Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Thu, 20 May 2021 18:38:05 +0800 Subject: [PATCH] =?UTF-8?q?20210520=E4=BF=AE=E6=94=B9=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=8D=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccsens/ht/bean/dto/PatientReportDto.java | 4 +- .../com/ccsens/ht/service/ExportService.java | 45 ++++++++++--------- .../ht/service/PatientReportService.java | 34 ++++++++++++-- ht/src/main/resources/application.yml | 4 +- 4 files changed, 58 insertions(+), 29 deletions(-) diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java index e129407c..87096b46 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java +++ b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java @@ -39,8 +39,6 @@ public class PatientReportDto { @ApiModelProperty("初步印象") @NotNull(message="初步印象不能为空") private String initialImpression; - @ApiModelProperty("受试者合作评分") - private Integer workingScore; @ApiModelProperty("临床诊断") @NotNull(message = "临床诊断不能为空") private String clinicalDiagnosis; @@ -57,6 +55,8 @@ public class PatientReportDto { private Long id; @ApiModelProperty("报告单类型") private String report = "REPORT1.0"; + @ApiModelProperty("受试者合作评分") + private Integer workingScore; public HtPatientReport copy(){ HtPatientReport report = new HtPatientReport(); diff --git a/ht/src/main/java/com/ccsens/ht/service/ExportService.java b/ht/src/main/java/com/ccsens/ht/service/ExportService.java index 653053be..5f18eb25 100644 --- a/ht/src/main/java/com/ccsens/ht/service/ExportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/ExportService.java @@ -74,10 +74,10 @@ public class ExportService implements IExportService { if (detail == null) { throw new BaseException(CodeEnum.REPORT_NOT_FOUND); } - //添加受试者合作评分和初步印象 log.info("报告单和试题信息 {}", detail); + //添加受试者合作评分和初步印象 PatientReportVo.ReprotPatient patient = detail.getPatient(); - patient.setWorkingScore(reportRelevance.getSocre()); + patient.setWorkingScore(ObjectUtil.isNull(reportRelevance.getSocre()) ? 0 : reportRelevance.getSocre()); patient.setInitialImpression(reportRelevance.getImpression()); //生成写入pdf数据 List content = new ArrayList<>(); @@ -127,26 +127,27 @@ public class ExportService implements IExportService { String d = "D 不满、需多次要求配合,拒绝部分检查;\n"; String e = "E 不配合或拒绝"; String s = ""; - switch (detail.getPatient().getWorkingScore()){ - case 0: - s = "√ " + a + " " + b + " " + c + " " + d + " " + e; - break; - case 1: - s = " " + a + "√ " + b + " " + c + " " + d + " " + e; - break; - case 2: - s = " " + a + " " + b + "√ " + c + " " + d + " " + e; - break; - case 3: - s = " " + a + " " + b + " " + c + "√ " + d + " " + e; - break; - case 4: - s = " " + a + " " + b + " " + c + " " + d + "√ " + e; - break; - default: - s = a + b + c + d + e; - break; - } + s = a + b + c + d + e; +// switch (detail.getPatient().getWorkingScore()){ +// case 0: +// s = "√ " + a + " " + b + " " + c + " " + d + " " + e; +// break; +// case 1: +// s = " " + a + "√ " + b + " " + c + " " + d + " " + e; +// break; +// case 2: +// s = " " + a + " " + b + "√ " + c + " " + d + " " + e; +// break; +// case 3: +// s = " " + a + " " + b + " " + c + "√ " + d + " " + e; +// break; +// case 4: +// s = " " + a + " " + b + " " + c + " " + d + "√ " + e; +// break; +// default: +// s = a + b + c + d + e; +// break; +// } // String s = "√ A 感兴趣、配合关心结果;\n" + // " B 表现出感兴趣和合作,出于对医生的友好;\n" + // " C 顺从、不感兴趣;\n" + diff --git a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java index b2808599..e036a7e7 100644 --- a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java @@ -17,6 +17,7 @@ import com.ccsens.ht.persist.dao.*; import com.ccsens.ht.persist.mapper.HtPatientFollowUpMapper; import com.ccsens.ht.persist.mapper.HtPatientMapper; import com.ccsens.ht.persist.mapper.HtPatientReportRecordMapper; +import com.ccsens.ht.persist.mapper.HtReportRelevanceMapper; import com.ccsens.ht.uitl.Constant; import com.ccsens.util.*; import com.ccsens.util.exception.BaseException; @@ -71,6 +72,8 @@ public class PatientReportService implements IPatientReportService { private HtQuestionDao htQuestionDao; @Resource private IQuestionService questionService; + @Resource + private HtReportRelevanceMapper reportRelevanceMapper; @Override public JsonResponse generatePatientReport(PatientReportDto.Generate generate, Long userId) { @@ -136,9 +139,14 @@ public class PatientReportService implements IPatientReportService { log.info("不具备修改权限"); return CodeEnum.REPORT_DOCTOR_ERROR; } - + //查找初步印象,三个报告单有一个就可以,全部都没有则记录病人的随访记录 + HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample(); + relevanceExample.createCriteria().andReportCodeEqualTo(patientReport.getReport()) + .andReportIdEqualTo(patientReport.getId()).andImpressionIsNotNull(); + long l = reportRelevanceMapper.countByExample(relevanceExample); //记录病人的随访记录 - if (StrUtil.isEmpty(htPatientReport.getInitialImpression())) { +// if (StrUtil.isEmpty(htPatientReport.getInitialImpression())) { + if(l <= 0) { //1.统计病人的报告单的总数 HtPatientReportExample patientReportExample = new HtPatientReportExample(); patientReportExample.createCriteria().andPatientIdEqualTo(htPatientReport.getPatientId()).andInitialImpressionIsNotNull(); @@ -147,10 +155,30 @@ public class PatientReportService implements IPatientReportService { followUp.setId(snowflake.nextId()); followUp.setPatientId(htPatientReport.getPatientId()); followUp.setFollowUpDatetime(new Date()); - followUp.setFollowUpTimes((int)count+1); + followUp.setFollowUpTimes((int) count + 1); followUp.setRecorder(htPatientReport.getDoctorId()); followUp.setDiagnose(doctor.getId()); htPatientFollowUpMapper.insertSelective(followUp); +// } + } + //查找当前报告单类型的关联 + HtReportRelevanceExample relevanceExample1 = new HtReportRelevanceExample(); + relevanceExample1.createCriteria().andReportCodeEqualTo(patientReport.getReport()) + .andReportIdEqualTo(patientReport.getId()); + List htReportRelevances = reportRelevanceMapper.selectByExample(relevanceExample1); + HtReportRelevance reportRelevance = new HtReportRelevance(); + if(CollectionUtil.isNotEmpty(htReportRelevances)){ + reportRelevance = htReportRelevances.get(0); + reportRelevance.setImpression(patientReport.getInitialImpression()); + reportRelevance.setSocre(patientReport.getWorkingScore()); + reportRelevanceMapper.updateByPrimaryKeySelective(reportRelevance); + }else { + reportRelevance.setId(snowflake.nextId()); + reportRelevance.setReportId(patientReport.getId()); + reportRelevance.setReportCode(patientReport.getReport()); + reportRelevance.setImpression(patientReport.getInitialImpression()); + reportRelevance.setSocre(patientReport.getWorkingScore()); + reportRelevanceMapper.insertSelective(reportRelevance); } //修改报告单 HtPatientReport copy = patientReport.copy(); diff --git a/ht/src/main/resources/application.yml b/ht/src/main/resources/application.yml index 4ecd13fd..f59084b0 100644 --- a/ht/src/main/resources/application.yml +++ b/ht/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: dev - include: common, util-dev + active: test + include: common, util-test