Browse Source

检查患者未完成的报告单

sd
zhizhi wu 4 years ago
parent
commit
f042161294
  1. 14
      question/src/main/java/com/ccsens/question/api/PatientReportController.java
  2. 12
      question/src/main/java/com/ccsens/question/bean/dto/PatientReportDto.java
  3. 18
      question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java
  4. 8
      question/src/main/java/com/ccsens/question/persist/dao/HtPatientReportDao.java
  5. 8
      question/src/main/java/com/ccsens/question/service/IPatientReportService.java
  6. 28
      question/src/main/java/com/ccsens/question/service/PatientReportService.java
  7. 2
      question/src/main/java/com/ccsens/question/uitl/Constant.java
  8. 6
      question/src/main/resources/mapper_dao/HtPatientReportDao.xml

14
question/src/main/java/com/ccsens/question/api/PatientReportController.java

@ -52,6 +52,20 @@ public class PatientReportController {
return JsonResponse.newInstance().ok(); return JsonResponse.newInstance().ok();
} }
@MustLogin
@DoctorAudit
@ApiOperation(value = "检查患者是否有未完成的报告单, 无则生成",notes = "检查患者是否有未完成的报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "报告单信息", required = true)
})
@RequestMapping(value="/checkPatientComplete", method = RequestMethod.POST)
public JsonResponse<PatientReportVo.CompleteSimple> checkPatientComplete(@RequestBody @ApiParam @Valid QueryDto<PatientReportDto.Patient> dto){
log.info("检查患者是否有未完成的报告单:{}", dto);
PatientReportVo.CompleteSimple complete = patientReportService.checkPatientComplete(dto.getParam(), dto.getUserId());
log.info("检查患者是否有未完成的报告单返回:{}", complete);
return JsonResponse.newInstance().ok(complete);
}
@MustLogin @MustLogin
@DoctorAudit @DoctorAudit
@ApiOperation(value = "检查是否有未完成的报告单",notes = "检查是否有未完成的报告单") @ApiOperation(value = "检查是否有未完成的报告单",notes = "检查是否有未完成的报告单")

12
question/src/main/java/com/ccsens/question/bean/dto/PatientReportDto.java

@ -19,6 +19,16 @@ import javax.validation.constraints.NotNull;
*/ */
public class PatientReportDto { public class PatientReportDto {
@Data
@ApiModel("患者信息")
public static class Patient{
@ApiModelProperty("病人ID")
@NotNull(message = "请选择患者信息")
private Long patientId;
@ApiModelProperty("病案号")
private String serialNumber;
}
@Data @Data
@ApiModel("忽略未完成的报告单") @ApiModel("忽略未完成的报告单")
public static class Ignore{ public static class Ignore{
@ -33,6 +43,8 @@ public class PatientReportDto {
@ApiModelProperty("病人ID") @ApiModelProperty("病人ID")
@NotNull(message = "病人ID不能为空") @NotNull(message = "病人ID不能为空")
private Long patientId; private Long patientId;
@ApiModelProperty("病案号")
private String serialNumber;
} }
@ApiModel("PatientReportDtoEdit") @ApiModel("PatientReportDtoEdit")

18
question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java

@ -21,6 +21,22 @@ import java.util.*;
*/ */
public class PatientReportVo { public class PatientReportVo {
@Data
@ApiModel("报告单遗留未完成简单版")
public static class CompleteSimple {
@ApiModelProperty("是否有未完成的项目 1:有 0:无")
private byte hasUnfinished = 0;
@ApiModelProperty("报告单ID")
private Long id;
@ApiModelProperty("报告单名字")
private String name;
@ApiModelProperty("病人ID")
private Long patientId;
@ApiModelProperty("病案号")
private String serialNumber;
}
@Data @Data
@ApiModel("报告单遗留未完成") @ApiModel("报告单遗留未完成")
public static class Complete { public static class Complete {
@ -170,7 +186,7 @@ public class PatientReportVo {
String pasiStr = this.pasi == 3 ? "重度" : this.pasi == 2 ? "中度" : this.pasi == 1 ? "轻度" : ""; String pasiStr = this.pasi == 3 ? "重度" : this.pasi == 2 ? "中度" : this.pasi == 1 ? "轻度" : "";
rows.add( rows.add(
fillRow( fillRow(
"病案号:", "病案号:" + (StrUtil.isEmpty(serialNumber) ? "" : serialNumber),
"临床诊断:" + (StrUtil.isEmpty(this.clinicalDiagnosis) ? "" : this.clinicalDiagnosis), "临床诊断:" + (StrUtil.isEmpty(this.clinicalDiagnosis) ? "" : this.clinicalDiagnosis),
"严重程度:" + pasiStr) "严重程度:" + pasiStr)
// "检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd"))) // "检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd")))

8
question/src/main/java/com/ccsens/question/persist/dao/HtPatientReportDao.java

@ -104,4 +104,12 @@ public interface HtPatientReportDao extends HtPatientReportMapper {
* @return 报告单 * @return 报告单
*/ */
List<PatientReportSearchVo.Search> search(@Param("codes") List<PatientReportSearchDto.Search> codes); List<PatientReportSearchVo.Search> search(@Param("codes") List<PatientReportSearchDto.Search> codes);
/**
* 检查患者未完成的报告单
* @param param 患者信息
* @param userId 用户ID
* @return 报告单
*/
PatientReportVo.CompleteSimple checkPatientComplete(@Param("patient") PatientReportDto.Patient param, @Param("userId") Long userId);
} }

8
question/src/main/java/com/ccsens/question/service/IPatientReportService.java

@ -157,4 +157,12 @@ public interface IPatientReportService {
* @return 报告单 * @return 报告单
*/ */
List<PatientReportSearchVo.Search> search(PatientReportSearchDto.SearchList param); List<PatientReportSearchVo.Search> search(PatientReportSearchDto.SearchList param);
/**
*
* @param param
* @param userId
* @return
*/
PatientReportVo.CompleteSimple checkPatientComplete(PatientReportDto.Patient param, Long userId);
} }

28
question/src/main/java/com/ccsens/question/service/PatientReportService.java

@ -87,6 +87,7 @@ public class PatientReportService implements IPatientReportService {
htPatientReport.setId(snowflake.nextId()); htPatientReport.setId(snowflake.nextId());
// htPatientReport.setDoctorId(doctors.get(0).getId()); // htPatientReport.setDoctorId(doctors.get(0).getId());
htPatientReport.setPatientId(generate.getPatientId()); htPatientReport.setPatientId(generate.getPatientId());
htPatientReport.setSerialNumber(generate.getSerialNumber());
// htPatientReport.setPatientIdcard(htPatient.getIdcard()); // htPatientReport.setPatientIdcard(htPatient.getIdcard());
// htPatientReport.setPatientAge(StrUtil.isEmpty(htPatient.getIdcard()) ? null : (byte)IdcardUtil.getAgeByIdCard(htPatient.getIdcard())); // htPatientReport.setPatientAge(StrUtil.isEmpty(htPatient.getIdcard()) ? null : (byte)IdcardUtil.getAgeByIdCard(htPatient.getIdcard()));
htPatientReport.setEvaluationCode(Constant.Ht.Report.PARENT_CODE); htPatientReport.setEvaluationCode(Constant.Ht.Report.PARENT_CODE);
@ -99,6 +100,7 @@ public class PatientReportService implements IPatientReportService {
log.info("生成病友报告单:{}", generate); log.info("生成病友报告单:{}", generate);
PatientReportVo.Generate generateVo = new PatientReportVo.Generate(); PatientReportVo.Generate generateVo = new PatientReportVo.Generate();
generateVo.setId(htPatientReport.getId()); generateVo.setId(htPatientReport.getId());
generateVo.setName(htPatientReport.getName());
return JsonResponse.newInstance().ok(generateVo); return JsonResponse.newInstance().ok(generateVo);
} }
@ -607,5 +609,31 @@ public class PatientReportService implements IPatientReportService {
return list; return list;
} }
@Override
public PatientReportVo.CompleteSimple checkPatientComplete(PatientReportDto.Patient param, Long userId) {
PatientReportVo.CompleteSimple simple = htPatientReportDao.checkPatientComplete(param, userId);
log.info("检查患者未完成的报告单:{}", simple);
if (simple != null) {
simple.setHasUnfinished(Constant.Ht.UNCLOSED_REPORT);
return simple;
}
PatientReportDto.Generate generate = new PatientReportDto.Generate();
generate.setPatientId(param.getPatientId());
generate.setSerialNumber(param.getSerialNumber());
JsonResponse<PatientReportVo.Generate> result = generatePatientReport(generate, userId);
if (result.getCode() != CodeEnum.SUCCESS.getCode().intValue()) {
throw new BaseException(result.getCode(), result.getMsg());
}
simple = new PatientReportVo.CompleteSimple();
PatientReportVo.Generate data = result.getData();
simple.setId(data.getId());
simple.setName(data.getName());
simple.setPatientId(param.getPatientId());
simple.setSerialNumber(param.getSerialNumber());
return simple;
}
} }

2
question/src/main/java/com/ccsens/question/uitl/Constant.java

@ -62,6 +62,8 @@ public class Constant {
public final static byte SEX_WOMAN = 1; public final static byte SEX_WOMAN = 1;
/**删除*/ /**删除*/
public final static byte IS_DEL = 1; public final static byte IS_DEL = 1;
/**未结束的报告单*/
public final static byte UNCLOSED_REPORT = 1;

6
question/src/main/resources/mapper_dao/HtPatientReportDao.xml

@ -256,6 +256,12 @@
</if> </if>
</foreach> </foreach>
</select> </select>
<select id="checkPatientComplete" resultType="com.ccsens.question.bean.vo.PatientReportVo$CompleteSimple">
select r.id, r.name, r.patient_id as patientId, r.serial_number as serialNumber, r.create_time as createTime
from t_ht_patient_report r
where r.patient_id = #{patient.patientId} and r.complete_status = 0 and r.is_del = 0
order by r.create_time desc limit 1
</select>
</mapper> </mapper>
Loading…
Cancel
Save