|
@@ -55,69 +55,68 @@ public class InspectionsService {
|
|
|
this.electroService = electroService;
|
|
|
}
|
|
|
|
|
|
- public List<ExamIndexResponse> checkExamIndex(ReportIndexInquiry inquiry) {
|
|
|
- inquiry.setOpenid(TokenUtil.getInstance().getUserOpenid());
|
|
|
- int exist = dao.selectPatIdAndOpenidMatchCount(inquiry.getPatientId(), inquiry.getOpenid());
|
|
|
+ public List<ExamIndexResponse> checkExamIndex(ReportIndexInquiry request) {
|
|
|
+ request.setOpenid(TokenUtil.getInstance().getUserOpenid());
|
|
|
+ int exist = dao.selectPatIdAndOpenidMatchCount(request.getPatientId(), request.getOpenid());
|
|
|
if (exist == 0) {
|
|
|
throw new BizException(ExceptionEnum.TOKEN_ERROR);
|
|
|
}
|
|
|
- healthCardService.reportHisData(inquiry.getPatientId(), "0101082", null ,null);
|
|
|
+ healthCardService.reportHisData(request.getPatientId(), "0101082", null ,null);
|
|
|
List<ExamIndexRequest> requestList = new ArrayList<>();
|
|
|
requestList.add(new ExamIndexRequest.Builder()
|
|
|
- .patientNumType("OutPatient").patientNum(inquiry.getPatientId())
|
|
|
- .startDate(inquiry.getReqStartTime()).endDate(inquiry.getReqEndTime()).build());
|
|
|
+ .patientNumType("OutPatient").patientNum(request.getPatientId())
|
|
|
+ .startDate(request.getReqStartTime()).endDate(request.getReqEndTime()).build());
|
|
|
|
|
|
- ResultVo<List<Map<String, String>>> response = thmzService.getParentIdByPatientId(inquiry.getPatientId());
|
|
|
+ ResultVo<List<Map<String, String>>> response = thmzService.getParentIdByPatientId(request.getPatientId());
|
|
|
if (response.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
List<Map<String, String>> list = response.getData();
|
|
|
String patientId = list.get(0).get("parentPatientId");
|
|
|
requestList.add(new ExamIndexRequest.Builder()
|
|
|
.patientNumType("OutPatient").patientNum(patientId)
|
|
|
- .startDate(inquiry.getReqStartTime()).endDate(inquiry.getReqEndTime()).build());
|
|
|
+ .startDate(request.getReqStartTime()).endDate(request.getReqEndTime()).build());
|
|
|
}
|
|
|
- final String tjNo = dao.selectTjNo(inquiry.getPatientId());
|
|
|
+ final String tjNo = dao.selectTjNo(request.getPatientId());
|
|
|
if (StringUtil.notBlank(tjNo)) {
|
|
|
requestList.add(new ExamIndexRequest.Builder()
|
|
|
.patientNumType("Pis").patientNum(tjNo)
|
|
|
- .startDate(inquiry.getReqStartTime()).endDate(inquiry.getReqEndTime()).build());
|
|
|
+ .startDate(request.getReqStartTime()).endDate(request.getReqEndTime()).build());
|
|
|
}
|
|
|
- List<String> inpatientNos = inpatientService.getInpatientNoByPatientId(inquiry.getPatientId());
|
|
|
+ List<String> inpatientNos = inpatientService.getInpatientNoByPatientId(request.getPatientId());
|
|
|
for (String inpatientNo : inpatientNos) {
|
|
|
requestList.add(new ExamIndexRequest.Builder()
|
|
|
.patientNumType("InPatient").patientNum(inpatientNo)
|
|
|
- .startDate(inquiry.getReqStartTime()).endDate(inquiry.getReqEndTime()).build());
|
|
|
+ .startDate(request.getReqStartTime()).endDate(request.getReqEndTime()).build());
|
|
|
}
|
|
|
|
|
|
List<ExamIndexResponse> list = new ArrayList<>();
|
|
|
- for (ExamIndexRequest request : requestList) {
|
|
|
- list.addAll(examReportService.queryExamIndex(request));
|
|
|
+ for (ExamIndexRequest requestItem : requestList) {
|
|
|
+ list.addAll(examReportService.queryExamIndex(requestItem));
|
|
|
}
|
|
|
list.removeIf(item -> Objects.equals(item.getPatientNumType(), "3"));
|
|
|
list.sort(Comparator.comparing(ExamIndexResponse::getTrscDate).reversed());
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- public ExamDetailResponse checkExamDetail(ReportDetailInquiry param) {
|
|
|
- if (StringUtil.isBlank(param.getReportId())) {
|
|
|
+ public ExamDetailResponse checkExamDetail(ReportDetailInquiry request) {
|
|
|
+ if (StringUtil.isBlank(request.getReportId())) {
|
|
|
throw new BizException("报告ID不能为空!");
|
|
|
}
|
|
|
- param.setOpenid(TokenUtil.getInstance().getUserOpenid());
|
|
|
- int exist = dao.selectPatIdAndOpenidMatchCount(param.getPatientId(), param.getOpenid());
|
|
|
+ request.setOpenid(TokenUtil.getInstance().getUserOpenid());
|
|
|
+ int exist = dao.selectPatIdAndOpenidMatchCount(request.getPatientId(), request.getOpenid());
|
|
|
if (exist == 0) {
|
|
|
throw new BizException(ExceptionEnum.TOKEN_ERROR);
|
|
|
}
|
|
|
- ExamDetailResponse response = examReportService.queryExamDetail(param.getReportId());
|
|
|
- response.setPics(examReportService.queryExamPic(param.getReportId()));
|
|
|
+ ExamDetailResponse response = examReportService.queryExamDetail(request.getReportId());
|
|
|
+ response.setPics(examReportService.queryExamPic(request.getReportId()));
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
- public List<TestReport> checkTestIndex(ReportIndexInquiry inquiry) {
|
|
|
- inquiry.setReqEndTime(inquiry.getReqEndTime() + " 23:59:59");
|
|
|
- List<TestReport> list = dao.selectTestReportIndex(inquiry);
|
|
|
- List<String> inpatientNos = inpatientService.getInpatientNoByPatientId(inquiry.getPatientId());
|
|
|
+ public List<TestReport> checkTestIndex(ReportIndexInquiry request) {
|
|
|
+ List<TestReport> list = dao.selectTestReportIndex(request);
|
|
|
+ List<String> inpatientNos = inpatientService.getInpatientNoByPatientId(request.getPatientId());
|
|
|
for (String inpatientNo : inpatientNos) {
|
|
|
- inquiry.setPatientId(inpatientNo);
|
|
|
- list.addAll(dao.selectTestReportIndex(inquiry));
|
|
|
+ request.setPatientId(inpatientNo);
|
|
|
+ list.addAll(dao.selectTestReportIndex(request));
|
|
|
}
|
|
|
return list;
|
|
|
}
|