Browse Source

20210520修改报告单信息

sd
zy_Java 4 years ago
parent
commit
52867a8121
  1. 4
      ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java
  2. 43
      ht/src/main/java/com/ccsens/ht/service/ExportService.java
  3. 32
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  4. 4
      ht/src/main/resources/application.yml

4
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();

43
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<PdfUtil.Row> 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;
}
// 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" +

32
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<PatientReportVo.Generate> 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();
@ -151,6 +159,26 @@ public class PatientReportService implements IPatientReportService {
followUp.setRecorder(htPatientReport.getDoctorId());
followUp.setDiagnose(doctor.getId());
htPatientFollowUpMapper.insertSelective(followUp);
// }
}
//查找当前报告单类型的关联
HtReportRelevanceExample relevanceExample1 = new HtReportRelevanceExample();
relevanceExample1.createCriteria().andReportCodeEqualTo(patientReport.getReport())
.andReportIdEqualTo(patientReport.getId());
List<HtReportRelevance> 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();

4
ht/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring:
profiles:
active: dev
include: common, util-dev
active: test
include: common, util-test

Loading…
Cancel
Save