|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.client.QcServiceClient;
|
|
|
import com.diagbot.dto.BehospitalInfoDTO;
|
|
|
import com.diagbot.dto.OutputInfo;
|
|
|
+import com.diagbot.dto.QcCasesEntryDTO;
|
|
|
import com.diagbot.dto.Response;
|
|
|
import com.diagbot.service.impl.BehospitalInfoServiceImpl;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
@@ -28,12 +29,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
@Autowired
|
|
|
QcServiceClient qcServiceClient;
|
|
|
+ @Autowired
|
|
|
+ private QcCasesEntryFacade qcCasesEntryFacade;
|
|
|
|
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
|
|
|
|
behospitalPageVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
|
|
|
IPage<BehospitalInfoDTO> res = getPage(behospitalPageVO);
|
|
|
- List<BehospitalInfoDTO> behospitalInfoDTOList = res.getRecords();
|
|
|
+ List<BehospitalInfoDTO> behospitalInfoDTOList = res.getRecords();
|
|
|
for (BehospitalInfoDTO behospitalInfo : behospitalInfoDTOList) {
|
|
|
if (behospitalInfo != null && behospitalInfo.getBirthday() != null) {
|
|
|
behospitalInfo.setAge(getAge(behospitalInfo.getBirthday()));
|
|
@@ -46,6 +49,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
public Map<String, Object> analyze(AnalyzeVO analyzeVO) {
|
|
|
|
|
|
// TODO 获取质控条目
|
|
|
+ List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
|
|
|
|
// TODO 获取病历所有数据
|
|
|
|
|
@@ -67,12 +71,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param birthDay
|
|
|
* @return
|
|
|
*/
|
|
|
- public int getAge(Date birthDay){
|
|
|
+ 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!");
|
|
|
+ // throw new IllegalArgumentException(
|
|
|
+ // "The birthDay is before Now.It's unbelievable!");
|
|
|
}
|
|
|
int yearNow = cal.get(Calendar.YEAR); //当前年份
|
|
|
int monthNow = cal.get(Calendar.MONTH); //当前月份
|
|
@@ -84,8 +88,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
int age = yearNow - yearBirth; //计算整岁数
|
|
|
if (monthNow <= monthBirth) {
|
|
|
if (monthNow == monthBirth) {
|
|
|
- if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
|
|
|
- }else{
|
|
|
+ if (dayOfMonthNow < dayOfMonthBirth) {
|
|
|
+ age--;//当前日期在生日之前,年龄减一
|
|
|
+ }
|
|
|
+ } else {
|
|
|
age--;//当前月份在生日之前,年龄减一
|
|
|
}
|
|
|
}
|