|
|
@ -1,8 +1,10 @@ |
|
|
|
package com.ccsens.tcm.service; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.lang.Snowflake; |
|
|
|
import com.ccsens.tcm.bean.dto.ConRecDto; |
|
|
|
import com.ccsens.tcm.bean.dto.PatientDto; |
|
|
|
import com.ccsens.tcm.bean.dto.StatisticDto; |
|
|
|
import com.ccsens.tcm.bean.po.PatientInformation; |
|
|
|
import com.ccsens.tcm.bean.po.PatientRecord; |
|
|
|
import com.ccsens.tcm.bean.po.PatientRecordExample; |
|
|
@ -10,12 +12,15 @@ import com.ccsens.tcm.bean.po.ReportCode; |
|
|
|
import com.ccsens.tcm.bean.vo.ConRecVo; |
|
|
|
import com.ccsens.tcm.bean.vo.PatientVo; |
|
|
|
import com.ccsens.tcm.bean.vo.QuestionVo; |
|
|
|
import com.ccsens.tcm.bean.vo.StatisticVo; |
|
|
|
import com.ccsens.tcm.persist.dao.PatientDao; |
|
|
|
import com.ccsens.tcm.persist.mapper.PatientInformationMapper; |
|
|
|
import com.ccsens.tcm.persist.mapper.PatientRecordMapper; |
|
|
|
import com.ccsens.tcm.persist.mapper.ReportCodeMapper; |
|
|
|
import com.ccsens.tcm.uitl.Constant; |
|
|
|
import com.ccsens.util.CodeEnum; |
|
|
|
import com.ccsens.util.RedisUtil; |
|
|
|
import com.ccsens.util.exception.BaseException; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -79,7 +84,7 @@ public class PatientService implements IPatientService { |
|
|
|
PatientInformation patientInformation = patientInformationMapper.selectByPrimaryKey(param.getPatientId()); |
|
|
|
onsetTime=patientInformation.getCreatedAt(); |
|
|
|
} |
|
|
|
//试题只需要记录3次的 9 和30 算分界限 <9 =0 ;<30 =14 ; >30 =90
|
|
|
|
//试题只需要记录3次的 9 和30 算分界限 <9 =0 ;<30 =14 ; >30 =90 记录2次的 270 算分界线 <270 算180 ,>270 算365
|
|
|
|
int one=9; |
|
|
|
int two=30; |
|
|
|
int oneFront=0; |
|
|
@ -172,21 +177,25 @@ public class PatientService implements IPatientService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<QuestionVo.ReportCodeVo> selSearchCriteriaList() { |
|
|
|
List<QuestionVo.ReportCodeVo> reportCodeVos=null; |
|
|
|
List<Object> objects = redisUtil.lGet(Constant.Redis.CODE_QUESTION, 0, -1); |
|
|
|
List<QuestionVo.ReportCodeVo> reportCodeVos = (List<QuestionVo.ReportCodeVo>)objects.get(0); |
|
|
|
for (int i = 0; i < reportCodeVos.size(); i++) { |
|
|
|
List<QuestionVo.CodeQuestionVo> codeQuestionVoList= reportCodeVos.get(i).getQuestionVos(); |
|
|
|
for (int i1 = 0; i1 < codeQuestionVoList.size(); i1++) { |
|
|
|
if(codeQuestionVoList.get(i1).getSearchCriteria()==(byte)0){ |
|
|
|
codeQuestionVoList.remove(i1); |
|
|
|
if(i1==0){ |
|
|
|
i1=0; |
|
|
|
}else { |
|
|
|
i1--; |
|
|
|
if (CollectionUtil.isEmpty(reportCodeVos)){ |
|
|
|
throw new BaseException(CodeEnum.MESSAGEISNULL); |
|
|
|
} |
|
|
|
reportCodeVos = (List<QuestionVo.ReportCodeVo>)objects.get(0); |
|
|
|
for (int i = 0; i < reportCodeVos.size(); i++) { |
|
|
|
List<QuestionVo.CodeQuestionVo> codeQuestionVoList = reportCodeVos.get(i).getQuestionVos(); |
|
|
|
for (int i1 = 0; i1 < codeQuestionVoList.size(); i1++) { |
|
|
|
if (codeQuestionVoList.get(i1).getSearchCriteria() == (byte) 0) { |
|
|
|
codeQuestionVoList.remove(i1); |
|
|
|
if (i1 == 0) { |
|
|
|
i1 = 0; |
|
|
|
} else { |
|
|
|
i1--; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return reportCodeVos; |
|
|
|
} |
|
|
|
|
|
|
@ -197,6 +206,13 @@ public class PatientService implements IPatientService { |
|
|
|
return new PageInfo<>(selPatientList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public StatisticVo.SelCountS countCase(StatisticDto.SelCount param, Long userId) { |
|
|
|
StatisticVo.SelCountS selCountS=new StatisticVo.SelCountS(); |
|
|
|
selCountS.setNewNums(patientDao.countCase(param,(byte)0)); |
|
|
|
return selCountS; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 换算时间差 ,返回两个时间 之间差几天,要是小于1天,按照1的算,要是大于1的话,小于2的话,说的是秒啊。按照2的算,进一法啊 |
|
|
|
* @param bigDate 大时间 |
|
|
|