|
@@ -21,6 +21,7 @@ import com.diagbot.entity.DoctorAdvice;
|
|
|
import com.diagbot.entity.HomeDiagnoseInfo;
|
|
|
import com.diagbot.entity.HomeOperationInfo;
|
|
|
import com.diagbot.entity.HomePage;
|
|
|
+import com.diagbot.entity.QcCasesEntryPagedata;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -45,7 +46,6 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
-import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -86,6 +86,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
QcModeFacade qcModeFacade;
|
|
|
@Autowired
|
|
|
AuthServiceClient authServiceClient;
|
|
|
+ @Autowired
|
|
|
+ QcCasesEntryPagedataFacade qcCasesEntryPagedataFacade;
|
|
|
|
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
|
//入参验证
|
|
@@ -158,6 +160,22 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
BeanUtil.copyProperties(getDetailVO, analyzeVO);
|
|
|
List<MsgDTO> msgDTOList = getMsg(analyzeVO);
|
|
|
+ List<Long> caseEntryId = msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList());
|
|
|
+ if (ListUtil.isNotEmpty(caseEntryId)) {
|
|
|
+ List<QcCasesEntryPagedata> qcCasesEntryPagedataList = qcCasesEntryPagedataFacade.list(new QueryWrapper<QcCasesEntryPagedata>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .in("cases_entry_id", caseEntryId)
|
|
|
+ );
|
|
|
+ Map<Long, List<QcCasesEntryPagedata>> pageKey = EntityUtil.makeEntityListMap(qcCasesEntryPagedataList, "casesEntryId");
|
|
|
+ for (MsgDTO msgDTO : msgDTOList) {
|
|
|
+ List<QcCasesEntryPagedata> pagedata = pageKey.get(msgDTO.getCasesEntryId());
|
|
|
+ if (ListUtil.isNotEmpty(pagedata)) {
|
|
|
+ msgDTO.setPageKeyList(pagedata.stream().map(r -> r.getPageKey()).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
|
|
|
res.put("msg", msgMap);
|
|
|
}
|
|
@@ -515,42 +533,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 通过日期计算年龄
|
|
|
- *
|
|
|
- * @param birthDay
|
|
|
- * @return
|
|
|
- */
|
|
|
- public int getAge(Date birthDay) {
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算
|
|
|
- return 0;
|
|
|
- // throw new IllegalArgumentException(
|
|
|
- // "The birthDay is before Now.It's unbelievable!");
|
|
|
- }
|
|
|
- int yearNow = cal.get(Calendar.YEAR); //当前年份
|
|
|
- int monthNow = cal.get(Calendar.MONTH); //当前月份
|
|
|
- int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
|
|
|
- cal.setTime(birthDay);
|
|
|
- int yearBirth = cal.get(Calendar.YEAR);
|
|
|
- int monthBirth = cal.get(Calendar.MONTH);
|
|
|
- int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
|
|
|
- int age = yearNow - yearBirth; //计算整岁数
|
|
|
- if (monthNow <= monthBirth) {
|
|
|
- if (monthNow == monthBirth) {
|
|
|
- if (dayOfMonthNow < dayOfMonthBirth) {
|
|
|
- age--;//当前日期在生日之前,年龄减一
|
|
|
- }
|
|
|
- } else {
|
|
|
- age--;//当前月份在生日之前,年龄减一
|
|
|
- }
|
|
|
- }
|
|
|
- if (age < 0) {
|
|
|
- return 0;
|
|
|
- }
|
|
|
- return age;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 执行未评分的病历
|
|
|
*/
|