|
@@ -1,9 +1,6 @@
|
|
package com.ywt.alipaympapi.service.impl;
|
|
package com.ywt.alipaympapi.service.impl;
|
|
|
|
|
|
-import com.ywt.alipaympapi.core.utils.BizUtil;
|
|
|
|
-import com.ywt.alipaympapi.core.utils.Checker;
|
|
|
|
-import com.ywt.alipaympapi.core.utils.ContextHelper;
|
|
|
|
-import com.ywt.alipaympapi.core.utils.StringHelper;
|
|
|
|
|
|
+import com.ywt.alipaympapi.core.utils.*;
|
|
import com.ywt.alipaympapi.models.vo.MedicalCardVo;
|
|
import com.ywt.alipaympapi.models.vo.MedicalCardVo;
|
|
import com.ywt.core.exception.AppMessageException;
|
|
import com.ywt.core.exception.AppMessageException;
|
|
import com.ywt.gapi.Result;
|
|
import com.ywt.gapi.Result;
|
|
@@ -75,8 +72,30 @@ public class IsvReportServiceImpl implements IsvReportService {
|
|
data.setReportDate(detail.getInspectionDate());
|
|
data.setReportDate(detail.getInspectionDate());
|
|
data.setReportImageDesc(detail.getInspectionResult());
|
|
data.setReportImageDesc(detail.getInspectionResult());
|
|
|
|
|
|
|
|
+ } else {
|
|
|
|
+ com.ywt.gapi.user.GetInspectionReportDetailRequest girdReq = com.ywt.gapi.user.GetInspectionReportDetailRequest.newBuilder()
|
|
|
|
+ .setReportId(request.getRecordId())
|
|
|
|
+ .setHospitalId(hospitalId)
|
|
|
|
+ .build();
|
|
|
|
+ com.ywt.gapi.user.GetInspectionReportDetailResponse girdResp = userServiceBlockingStub.getInspectionReportDetail(girdReq);
|
|
|
|
+ if (girdResp.getResult().getCode() == ResultCode.SUCCEED) {
|
|
|
|
+ List<String> reportItem = new ArrayList<>();
|
|
|
|
+ com.ywt.gapi.user.InspectionReportDetail detail = girdResp.getReport();
|
|
|
|
+ data.setRecordId(request.getRecordId());
|
|
|
|
+ data.setUserName(card.getPatientName());
|
|
|
|
+ data.setUserSex(card.getSex() == 1 ? "男" : "女");
|
|
|
|
+ data.setCardNum(Checker.getStringValue(card.getCardNum()));
|
|
|
|
+ data.setDepartmentName(detail.getDeptName());
|
|
|
|
+ data.setApplyDoctorName(Checker.getStringValue(detail.getAppDocName()));
|
|
|
|
+ reportItem.add(Checker.getStringValue(detail.getDiagnosis()));
|
|
|
|
+ data.setDiagnosis(reportItem);
|
|
|
|
+ data.setConfirmDoctorName(Checker.getStringValue(detail.getVerifyDocName()));
|
|
|
|
+ data.setReportDate(DateUtil.convertTimestampToDateString(detail.getExaminationDate(), "yyyy年MM月dd日 HH:mm:ss"));
|
|
|
|
+ data.setReportImageDesc(Checker.getStringValue(detail.getExamination()));
|
|
|
|
+ }
|
|
|
|
+ throw new AppMessageException("没有此报告");
|
|
}
|
|
}
|
|
- throw new AppMessageException("没有此报告");
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
if ("检验报告".equals(type)) {
|
|
if ("检验报告".equals(type)) {
|
|
GetLaboratoryDetailRequest req = GetLaboratoryDetailRequest.newBuilder()
|
|
GetLaboratoryDetailRequest req = GetLaboratoryDetailRequest.newBuilder()
|
|
@@ -87,6 +106,7 @@ public class IsvReportServiceImpl implements IsvReportService {
|
|
if (res.getCode() == ResultCode.SUCCEED_VALUE) {
|
|
if (res.getCode() == ResultCode.SUCCEED_VALUE) {
|
|
List<ReportItem> reportItemList = new ArrayList<>();
|
|
List<ReportItem> reportItemList = new ArrayList<>();
|
|
List<String> reportItem = new ArrayList<>();
|
|
List<String> reportItem = new ArrayList<>();
|
|
|
|
+ data.setDiagnosis(reportItem);
|
|
data.setUserName(card.getPatientName());
|
|
data.setUserName(card.getPatientName());
|
|
data.setItemName(res.getTitle());
|
|
data.setItemName(res.getTitle());
|
|
data.setReportDate(res.getTime());
|
|
data.setReportDate(res.getTime());
|
|
@@ -103,9 +123,35 @@ public class IsvReportServiceImpl implements IsvReportService {
|
|
reportItemList.add(r);
|
|
reportItemList.add(r);
|
|
}
|
|
}
|
|
data.setReportItemList(reportItemList);
|
|
data.setReportItemList(reportItemList);
|
|
-
|
|
|
|
|
|
+ } else {
|
|
|
|
+ com.ywt.gapi.user.GetLaboratoryReportDetailRequest glrdReq = com.ywt.gapi.user.GetLaboratoryReportDetailRequest.newBuilder()
|
|
|
|
+ .setInspectionId(request.getRecordId())
|
|
|
|
+ .setHospitalId(hospitalId)
|
|
|
|
+ .build();
|
|
|
|
+ com.ywt.gapi.user.GetLaboratoryReportDetailResponse glrdResp = userServiceBlockingStub.getLaboratoryReportDetail(glrdReq);
|
|
|
|
+ if (glrdResp.getResult().getCode() == ResultCode.SUCCEED) {
|
|
|
|
+ List<ReportItem> reportItemList = new ArrayList<>();
|
|
|
|
+ List<String> reportItem = new ArrayList<>();
|
|
|
|
+ data.setDiagnosis(reportItem);
|
|
|
|
+ data.setUserName(card.getPatientName());
|
|
|
|
+ data.setItemName(res.getTitle());
|
|
|
|
+ data.setReportDate(res.getTime());
|
|
|
|
+ data.setConfirmDoctorName(res.getDoctor());
|
|
|
|
+ data.setCardNum(Checker.getStringValue(card.getCardNum()));
|
|
|
|
+ data.setRecordId(request.getRecordId());
|
|
|
|
+ for (com.ywt.gapi.user.LaboratoryReportDetail detail : glrdResp.getDetailList()) {
|
|
|
|
+ ReportItem r = new ReportItem();
|
|
|
|
+ r.setItemName(detail.getItemName());
|
|
|
|
+ r.setPnFlag(Checker.getStringValue(detail.getResultFlag()));
|
|
|
|
+ r.setReference(detail.getItemRef());
|
|
|
|
+ r.setTxtVal(detail.getTestResult());
|
|
|
|
+ r.setUnit(detail.getUnit());
|
|
|
|
+ reportItemList.add(r);
|
|
|
|
+ }
|
|
|
|
+ data.setReportItemList(reportItemList);
|
|
|
|
+ }
|
|
|
|
+ throw new AppMessageException("没有此报告");
|
|
}
|
|
}
|
|
- throw new AppMessageException("没有此报告");
|
|
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -124,6 +170,8 @@ public class IsvReportServiceImpl implements IsvReportService {
|
|
int pageSize = request.getPageSize();
|
|
int pageSize = request.getPageSize();
|
|
String hisPatientId = request.getHisPatientId();
|
|
String hisPatientId = request.getHisPatientId();
|
|
int total = 0;
|
|
int total = 0;
|
|
|
|
+ int totalT = 0;
|
|
|
|
+ int totalTh = 0;
|
|
try {
|
|
try {
|
|
MedicalCardVo card = getCard(userId, hospitalId, hisPatientId);
|
|
MedicalCardVo card = getCard(userId, hospitalId, hisPatientId);
|
|
|
|
|
|
@@ -141,6 +189,31 @@ public class IsvReportServiceImpl implements IsvReportService {
|
|
da.setRecordId(Checker.getStringValue(q.getReportId()));
|
|
da.setRecordId(Checker.getStringValue(q.getReportId()));
|
|
da.setUserName(card.getPatientName());
|
|
da.setUserName(card.getPatientName());
|
|
da.setCardNum(card.getCardNum());
|
|
da.setCardNum(card.getCardNum());
|
|
|
|
+ da.setStatus(Checker.getStringValue(""));
|
|
|
|
+ da.setDiagnosis(Checker.getStringValue(""));
|
|
|
|
+ da.setType(Checker.getStringValue(""));
|
|
|
|
+ da.setApplyDate(Checker.getStringValue(""));
|
|
|
|
+ list.add(da);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ com.ywt.gapi.user.GetInspectionReportListRequest girlReq = com.ywt.gapi.user.GetInspectionReportListRequest.newBuilder()
|
|
|
|
+ .setMedicalCardId(card.getId())
|
|
|
|
+ .setUserId(userId)
|
|
|
|
+ .setHospitalId(hospitalId)
|
|
|
|
+ .build();
|
|
|
|
+ com.ywt.gapi.user.GetInspectionReportListResponse girlResp = userServiceBlockingStub.getInspectionReportList(girlReq);
|
|
|
|
+ if (girlResp.getResult().getCode() == ResultCode.SUCCEED) {
|
|
|
|
+ totalT = girlResp.getReportList().size();
|
|
|
|
+ for (com.ywt.gapi.user.InspectionReport report : girlResp.getReportList()) {
|
|
|
|
+ QueryReportListResponseData da = new QueryReportListResponseData();
|
|
|
|
+ da.setItemName(Checker.getStringValue(report.getReportTitle()));
|
|
|
|
+ da.setRecordId(Checker.getStringValue(report.getReportId()));
|
|
|
|
+ da.setUserName(card.getPatientName());
|
|
|
|
+ da.setCardNum(card.getCardNum());
|
|
|
|
+ da.setStatus(Checker.getStringValue(""));
|
|
|
|
+ da.setDiagnosis(Checker.getStringValue(""));
|
|
|
|
+ da.setType(Checker.getStringValue(""));
|
|
|
|
+ da.setApplyDate(Checker.getStringValue(""));
|
|
list.add(da);
|
|
list.add(da);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -164,11 +237,31 @@ public class IsvReportServiceImpl implements IsvReportService {
|
|
list.add(da);
|
|
list.add(da);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ com.ywt.gapi.user.GetLaboratoryReportListRequest glrlReq = com.ywt.gapi.user.GetLaboratoryReportListRequest.newBuilder()
|
|
|
|
+ .setMedicalCardId(card.getId())
|
|
|
|
+ .setUserId(userId)
|
|
|
|
+ .setHospitalId(hospitalId)
|
|
|
|
+ .build();
|
|
|
|
+ com.ywt.gapi.user.GetLaboratoryReportListResponse glrlResp = userServiceBlockingStub.getLaboratoryReportList(glrlReq);
|
|
|
|
+ if (glrlResp.getResult().getCode() == ResultCode.SUCCEED) {
|
|
|
|
+ totalT = glrlResp.getReportList().size();
|
|
|
|
+ for (com.ywt.gapi.user.LaboratoryReport report : glrlResp.getReportList()) {
|
|
|
|
+ QueryReportListResponseData da = new QueryReportListResponseData();
|
|
|
|
+ da.setItemName(Checker.getStringValue(report.getInspectionName()));
|
|
|
|
+ da.setDepartmentName(Checker.getStringValue(report.getDeptName()));
|
|
|
|
+ da.setRecordId(Checker.getStringValue(report.getInpatientId()));
|
|
|
|
+ da.setUserName(card.getPatientName());
|
|
|
|
+ da.setCardNum(card.getCardNum());
|
|
|
|
+ list.add(da);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
- Pagination pagination = new Pagination(pageIndex, pageSize, total);
|
|
|
|
|
|
+ totalTh = total + totalT;
|
|
|
|
+ Pagination pagination = new Pagination(pageIndex, pageSize, totalTh);
|
|
PageVO<QueryReportListResponseData> res = new PageVO<>(pagination, list);
|
|
PageVO<QueryReportListResponseData> res = new PageVO<>(pagination, list);
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
@@ -194,6 +287,7 @@ public class IsvReportServiceImpl implements IsvReportService {
|
|
for (MedicalCard card : list) {
|
|
for (MedicalCard card : list) {
|
|
if (hisPatientId.equals(card.getPatientId())) {
|
|
if (hisPatientId.equals(card.getPatientId())) {
|
|
MedicalCardVo v = new MedicalCardVo();
|
|
MedicalCardVo v = new MedicalCardVo();
|
|
|
|
+ v.setId(card.getCardId());
|
|
v.setSex(card.getSex());
|
|
v.setSex(card.getSex());
|
|
v.setHisPatientId(card.getPatientId());
|
|
v.setHisPatientId(card.getPatientId());
|
|
v.setPatientName(card.getPatientName());
|
|
v.setPatientName(card.getPatientName());
|