|
@@ -2,9 +2,12 @@ package com.diagbot.facade;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
+import com.diagbot.util.EntityUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -40,6 +43,9 @@ import com.diagbot.vo.SaveInquiryVO;
|
|
|
@Component
|
|
|
public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
|
|
|
+ @Value("${imageUrl.prefix}")
|
|
|
+ private String imageUrlPrefix;
|
|
|
+
|
|
|
@Autowired
|
|
|
private InquiryDetailFacade inquiryDetailFacade;
|
|
|
@Autowired
|
|
@@ -111,17 +117,17 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
|
|
|
return saveInquiryDTO;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 问诊记录检查确认
|
|
|
- *
|
|
|
+ *
|
|
|
* @param recordCheckVO
|
|
|
* @return
|
|
|
*/
|
|
|
public RecordCheckDTO recordCheck(RecordCheckVO recordCheckVO){
|
|
|
RecordCheckDTO recordCheckDTO = new RecordCheckDTO();
|
|
|
int type = 1;
|
|
|
-
|
|
|
+
|
|
|
QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
|
|
|
inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
inquiryInfoQe.eq("hospital_id", recordCheckVO.getHospitalId());
|
|
@@ -130,21 +136,21 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
inquiryInfoQe.eq("patient_id", recordCheckVO.getPatientId());
|
|
|
inquiryInfoQe.eq("inquiry_code", recordCheckVO.getInquiryCode());
|
|
|
InquiryInfo inquiryInfo = this.getOne(inquiryInfoQe);
|
|
|
-
|
|
|
+
|
|
|
if(inquiryInfo!=null){
|
|
|
QueryWrapper<InquiryDetail> inquiryDetailQe = new QueryWrapper<>();
|
|
|
inquiryDetailQe.eq("inquiry_id", inquiryInfo.getId());
|
|
|
if(inquiryDetailFacade.count(inquiryDetailQe)>0){
|
|
|
type = type + 2;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
QueryWrapper<InquiryEvaluator> inquiryEvaluatorQe = new QueryWrapper<>();
|
|
|
inquiryEvaluatorQe.eq("inquiry_id", inquiryInfo.getId());
|
|
|
if(inquiryEvaluatorFacade.count(inquiryEvaluatorQe)>0){
|
|
|
type = type + 3;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
recordCheckDTO.setType(type);
|
|
|
return recordCheckDTO;
|
|
|
}
|
|
@@ -255,12 +261,36 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
getInquiryDetailDTO.setInquiryTime(inquiryInfo.getGmtModified());
|
|
|
getInquiryDetailDTO.setPatientAge(DateUtil.yearCompare(inquiryInfo.getPatientBirthday(), DateUtil.now()));
|
|
|
|
|
|
- getInquiryDetailDTO.setChiefComplaint(inquiryDetailList.get(0).getContentValue());
|
|
|
- getInquiryDetailDTO.setXbs(inquiryDetailList.get(1).getContentValue());
|
|
|
- getInquiryDetailDTO.setQts(inquiryDetailList.get(2).getContentValue());
|
|
|
- getInquiryDetailDTO.setSupplement(inquiryDetailList.get(3).getContentValue());
|
|
|
+ if (ListUtil.isNotEmpty(inquiryDetailList)){
|
|
|
+ Map<Integer ,InquiryDetail> inquiryDetailMap
|
|
|
+ = EntityUtil.makeEntityMap(inquiryDetailList, "type");
|
|
|
+ if (null != inquiryDetailMap.get(1)){
|
|
|
+ getInquiryDetailDTO.setChiefComplaint(inquiryDetailMap.get(1).getContentValue());
|
|
|
+ }
|
|
|
+ if (null != inquiryDetailMap.get(2)){
|
|
|
+ getInquiryDetailDTO.setXbs(inquiryDetailMap.get(2).getContentValue());
|
|
|
+ }
|
|
|
+ if (null != inquiryDetailMap.get(3)){
|
|
|
+ getInquiryDetailDTO.setQts(inquiryDetailMap.get(3).getContentValue());
|
|
|
+ }
|
|
|
+ if (null != inquiryDetailMap.get(4)){
|
|
|
+ getInquiryDetailDTO.setSupplement(inquiryDetailMap.get(4).getContentValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
getInquiryDetailDTO.setPhysicalRes(ListUtil.isNotEmpty(inquiryEvaluatorList) ? inquiryEvaluatorList.get(0).getPhysicalRes() : null);
|
|
|
- getInquiryDetailDTO.setImageList(BeanUtil.listCopyTo(inquiryReportList, GetInquiryDetailImgDTO.class));
|
|
|
+ if (ListUtil.isNotEmpty(inquiryReportList)){
|
|
|
+ for (InquiryReport inquiryReport : inquiryReportList){
|
|
|
+ if (StringUtil.isNotBlank(inquiryReport.getOriginalImage())){
|
|
|
+ inquiryReport.setOriginalImage(imageUrlPrefix + inquiryReport.getOriginalImage());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(inquiryReport.getNarrowImage())){
|
|
|
+ inquiryReport.setNarrowImage(imageUrlPrefix + inquiryReport.getNarrowImage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getInquiryDetailDTO.setImageList(BeanUtil.listCopyTo(inquiryReportList, GetInquiryDetailImgDTO.class));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
return getInquiryDetailDTO;
|
|
|
}
|