|
|
|
@ -2,12 +2,10 @@ package com.ynxbd.common.action; |
|
|
|
|
|
|
|
|
|
import com.ynxbd.common.action.base.BaseAction; |
|
|
|
|
import com.ynxbd.common.bean.TreatRecord; |
|
|
|
|
import com.ynxbd.common.bean.enums.ReportEnum; |
|
|
|
|
import com.ynxbd.common.bean.lis.XBDLisReport; |
|
|
|
|
import com.ynxbd.common.bean.report.CheckReport; |
|
|
|
|
import com.ynxbd.common.bean.report.InspectionReport; |
|
|
|
|
import com.ynxbd.common.bean.report.PEIS; |
|
|
|
|
import com.ynxbd.common.dao.ReportDao; |
|
|
|
|
import com.ynxbd.common.dao.his.HisReportDao; |
|
|
|
|
import com.ynxbd.common.helper.common.DateHelper; |
|
|
|
|
import com.ynxbd.common.result.Result; |
|
|
|
@ -37,13 +35,13 @@ public class ReportAction extends BaseAction { |
|
|
|
|
@Action("getPEISByPatient") |
|
|
|
|
public Result getPEISByPatient(String name, String idCardNo, String patientId, String begDate, String endDate) { |
|
|
|
|
// http://localhost:8080/wx/report/getPEISByPatient.do?patientId=153671&idCardNo=533103198212184014&name=%E8%82%96%E7%81%BF&token=123
|
|
|
|
|
try { |
|
|
|
|
log.info("[体检报告]查询:patientId={}, idCardNo={}, name={}, begDate={}, endDate={}", patientId, idCardNo, name, begDate, endDate); |
|
|
|
|
if (patientId == null || idCardNo == null || name == null || begDate == null || endDate == null) { |
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<PEIS> reportList = new HisReportDao().getPEISReportByPatient(name, idCardNo, begDate, endDate); |
|
|
|
|
|
|
|
|
|
List<PEIS> resultList = new ArrayList<>(); |
|
|
|
|
for (PEIS report : reportList) { |
|
|
|
|
if (report.getExamDate() != null && DateHelper.inDateRange(begDate, endDate, report.getExamDate(), DateHelper.DateEnum.yyyy_MM_dd)) { |
|
|
|
@ -51,6 +49,9 @@ public class ReportAction extends BaseAction { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Result.success(resultList); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -59,6 +60,7 @@ public class ReportAction extends BaseAction { |
|
|
|
|
*/ |
|
|
|
|
@Action("getCheckByPatient") |
|
|
|
|
public Result getCheckByPatient(String begDate, String endDate, String patientId, String openid) { |
|
|
|
|
try { |
|
|
|
|
patientId = getDecodeString(patientId); |
|
|
|
|
// http://localhost:8080/wx/report/getCheckByPatient.do?patientId=153671&token=123
|
|
|
|
|
log.info("[检查报告]查询 patientId={}, begDate={}, endDate={}", patientId, begDate, endDate); |
|
|
|
@ -75,7 +77,11 @@ public class ReportAction extends BaseAction { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
new ReportService().updateReportPacsCount(); |
|
|
|
|
|
|
|
|
|
return Result.success(resultList); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -91,6 +97,7 @@ public class ReportAction extends BaseAction { |
|
|
|
|
*/ |
|
|
|
|
@Action("getTreatRecordList") |
|
|
|
|
public Result getTreatRecordList(String begDate, String endDate, String patientId, String patientType, String reportType, Boolean isLately, String deptCode) { |
|
|
|
|
try { |
|
|
|
|
patientId = getDecodeString(patientId); |
|
|
|
|
// http://localhost:8081/wx/report/getTreatRecordList.do?patientId=406212&begDate=201801-01&endDate=2020-08-12&patientType=0&reportType=2
|
|
|
|
|
if (patientId == null || begDate == null || endDate == null) { |
|
|
|
@ -99,10 +106,8 @@ public class ReportAction extends BaseAction { |
|
|
|
|
|
|
|
|
|
List<TreatRecord> records = new HisReportDao().getTreatRecordList(patientId, begDate, endDate, patientType, reportType, deptCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (records.size() > 0 && isLately != null && isLately) { |
|
|
|
|
if (!records.isEmpty() && isLately != null && isLately) { |
|
|
|
|
List<TreatRecord> resultList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
records.stream().max(Comparator.comparing(TreatRecord::getConsultDate)).ifPresent(resultList::add); |
|
|
|
|
return Result.success(resultList); |
|
|
|
|
} |
|
|
|
@ -113,6 +118,10 @@ public class ReportAction extends BaseAction { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Result.success(records); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -121,6 +130,7 @@ public class ReportAction extends BaseAction { |
|
|
|
|
*/ |
|
|
|
|
@Action("getInspectByPatient") |
|
|
|
|
public Result getInspectByPatient(String openid, String patientId, String begDate, String endDate) { |
|
|
|
|
try { |
|
|
|
|
patientId = getDecodeString(patientId); |
|
|
|
|
|
|
|
|
|
// http://localhost:8080/wx/report/getInspectByPatient.do?patientId=153671&token=123
|
|
|
|
@ -138,6 +148,9 @@ public class ReportAction extends BaseAction { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Result.success(resultList); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -145,6 +158,7 @@ public class ReportAction extends BaseAction { |
|
|
|
|
*/ |
|
|
|
|
@Action("getInspectByTreatNum") |
|
|
|
|
public Result getInspectByTreatNum(String type, String treatNum, String patientId) { |
|
|
|
|
try { |
|
|
|
|
treatNum = getDecodeString(treatNum); |
|
|
|
|
patientId = getDecodeString(patientId); |
|
|
|
|
// http://localhost:8080/wx/report/getInspectByTreatNum.do?patientId=153671&token=123
|
|
|
|
@ -176,8 +190,10 @@ public class ReportAction extends BaseAction { |
|
|
|
|
resultList.add(xbdLisReport); |
|
|
|
|
} |
|
|
|
|
return Result.success(resultList); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|