Browse Source

拉代码

recovery
wang1007152140 5 years ago
parent
commit
80232c35a9
  1. 3
      tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java
  2. 25
      tcm/src/main/java/com/ccsens/tcm/api/PatientController.java
  3. 37
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  4. 2
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  5. 7
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  6. 32
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  7. 26
      tcm/src/main/resources/mapper_dao/PatientDao.xml

3
tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java

@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author wang
*/
@ -25,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/conferenceRecords")
@Slf4j
public class ConferenceRecordsController {
@Resource
private IPatientService patientService;
// @MustLogin
@ApiOperation(value = "查询会议记录", notes = "w:根据会议记录查询条件查询会议记录")

25
tcm/src/main/java/com/ccsens/tcm/api/PatientController.java

@ -3,6 +3,7 @@ package com.ccsens.tcm.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.bean.vo.PatientVo;
import com.ccsens.tcm.bean.vo.QuestionVo;
import com.ccsens.tcm.service.IPatientService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
@ -27,7 +29,7 @@ import java.util.List;
@RequestMapping("/patient")
@Slf4j
public class PatientController {
@Resource
private IPatientService patientService;
@MustLogin
@ -39,6 +41,16 @@ public class PatientController {
log.info("添加患者基本信息成功");
return JsonResponse.newInstance().ok();
}
@MustLogin
@ApiOperation(value = "查询患者基本信息", notes = "w:查询患者基本信息")
@RequestMapping(value = "/selPatientMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<PatientVo.SelPatient>> selPatientInformationList(@ApiParam @Validated @RequestBody QueryDto<PatientDto.SelPatientList> params) {
log.info("查询患者基本信息:{}",params);
PageInfo<PatientVo.SelPatient> selPatientList= patientService.selPatientInformationList(params.getParam(),params.getUserId());
log.info("查询患者基本信息成功");
return JsonResponse.newInstance().ok(selPatientList);
}
@MustLogin
@ApiOperation(value = "保存患者病例信息", notes = "w:提交患者的相关病例信息")
@RequestMapping(value = "/saveCaseMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
@ -56,13 +68,12 @@ public class PatientController {
log.info("添加患者病例信息成功");
return JsonResponse.newInstance().ok(selPatientListPageInfo);
}
@ApiOperation(value = "通过查询搜索条件", notes = "w:通过查询搜索条件")
@ApiOperation(value = "查询搜索条件", notes = "w:查询搜索条件")
@RequestMapping(value = "/selSearchCriteriaList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<PatientVo.SelPatient>> selSearchCriteriaList() {
// List<PatientVo.SelPatient> selSearchCriteriaList= patientService.selSearchCriteriaList(params.getParam(),0L);
// log.info("通过查询搜索条件");
// return JsonResponse.newInstance().ok(selSearchCriteriaList);
return null;
public JsonResponse<List<QuestionVo.ReportCodeVo>> selSearchCriteriaList() {
List<QuestionVo.ReportCodeVo> selSearchCriteriaList= patientService.selSearchCriteriaList();
log.info("通过查询搜索条件");
return JsonResponse.newInstance().ok(selSearchCriteriaList);
}
}

37
tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java

@ -25,10 +25,29 @@ public class PatientDto {
@ApiModelProperty("对照组id")
private Integer inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")
private Byte inputStatus;
private Byte inputStatus=0;
@ApiModelProperty("医院id")
private Integer hospitalId;
}
@Data
@ApiModel("查询患者基本信息")
public static class SelPatientList {
@ApiModelProperty("病患id")
private Long id;
@ApiModelProperty("住院号")
private String hospitalization;
@ApiModelProperty("对照组id")
private Integer inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")
private Byte inputStatus;
@Min(1)
@ApiModelProperty("当前页")
private Integer pageNum=1;
@Min(1)
@Max(20)
@ApiModelProperty("每页数量")
private Integer pageSize=10;
}
@Data
@ApiModel("保存患者的多个病例信息")
@ -48,11 +67,25 @@ public class PatientDto {
@ApiModelProperty("内容")
private String contents;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("诊断时间")
private Date timeSlot=new Date(System.currentTimeMillis());
}
@Data
@ApiModel("查询的患者基本信息")
public static class SelPatient {
@ApiModelProperty("患者id")
private Long id;
@ApiModelProperty("住院号")
private String hospitalization;
@ApiModelProperty("对照组id")
private Integer inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")
private Byte inputStatus;
@ApiModelProperty("医院id")
private Integer hospitalId;
}
@Data
@ApiModel("查询患者的搜索条件集合")
public static class SelPatlenConditionList{
@ApiModelProperty("搜索条件集合,不包含时间格式的条件")

2
tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java

@ -16,4 +16,6 @@ public interface PatientDao {
List<ConRecVo.SelConRecVo> selConRec(ConRecDto.SelConRecDto param);
List<PatientVo.SelPatient> selPatientMesList(PatientDto.SelPatlenConditionList param);
List<PatientVo.SelPatient> selPatientInformationList(PatientDto.SelPatientList param);
}

7
tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java

@ -4,8 +4,11 @@ import com.ccsens.tcm.bean.dto.ConRecDto;
import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.bean.vo.ConRecVo;
import com.ccsens.tcm.bean.vo.PatientVo;
import com.ccsens.tcm.bean.vo.QuestionVo;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* @author wang
*/
@ -17,4 +20,8 @@ public interface IPatientService {
PageInfo<ConRecVo.SelConRecVo> selConRec(ConRecDto.SelConRecDto param, Long userId);
PageInfo<PatientVo.SelPatient> selPatientMesList(PatientDto.SelPatlenConditionList param, long l);
List<QuestionVo.ReportCodeVo> selSearchCriteriaList();
PageInfo<PatientVo.SelPatient> selPatientInformationList(PatientDto.SelPatientList param, Long userId);
}

32
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -9,10 +9,12 @@ import com.ccsens.tcm.bean.po.PatientRecordExample;
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.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.RedisUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -56,7 +58,8 @@ public class PatientService implements IPatientService {
@Override
public void saveCaseMes(PatientDto.saveCaseMes param, Long userId) {
//获取上次的发病时间
Long disease_time=Long.parseLong((String) redisUtil.get("disease_time"));
Long disease_time=Long.parseLong(String.valueOf(redisUtil.get(Constant.Redis.DISEASE_TIME)));
//Long disease_time=1355131504711442432L;
PatientRecordExample patientRecordExample1=new PatientRecordExample();
patientRecordExample1.createCriteria().andPatientIdEqualTo(param.getPatientId()).andTestQuestionsIdEqualTo(disease_time).andRecStatusEqualTo((byte)0);
List<PatientRecord> patientRecordList = patientRecordMapper.selectByExample(patientRecordExample1);
@ -167,6 +170,33 @@ public class PatientService implements IPatientService {
return new PageInfo<>(selPatientLists);
}
@Override
public List<QuestionVo.ReportCodeVo> selSearchCriteriaList() {
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--;
}
}
}
}
return reportCodeVos;
}
@Override
public PageInfo<PatientVo.SelPatient> selPatientInformationList(PatientDto.SelPatientList param, Long userId) {
PageHelper.startPage(param.getPageNum(),param.getPageSize());
List<PatientVo.SelPatient> selPatientList= patientDao.selPatientInformationList(param);
return new PageInfo<>(selPatientList);
}
/**
* 换算时间差 返回两个时间 之间差几天要是小于1天按照1的算要是大于1的话小于2的话说的是秒啊按照2的算,进一法啊
* @param bigDate 大时间

26
tcm/src/main/resources/mapper_dao/PatientDao.xml

@ -81,4 +81,30 @@
) t
)
</select>
<select id="selPatientInformationList" resultType="com.ccsens.tcm.bean.vo.PatientVo$SelPatient">
SELECT
tpi.id,
tpi.hospitalization,
tpi.inpatient_id AS inpatientId,
tpi.input_status AS inputStatus,
tpi.hospital_id AS hospitalId
FROM
t_patient_information tpi
WHERE
tpi.rec_status =0
<if test="id != null">
and tpi.id=#{id}
</if>
<if test="id == null">
<if test="hospitalization!=null">
and tpi.hospitalization=#{hospitalization}
</if>
<if test="inpatientId!=null">
and tpi.inpatient_id= #{inpatientId}
</if>
<if test="inputStatus!=null">
and tpi.input_status= #{inputStatus}
</if>
</if>
</select>
</mapper>
Loading…
Cancel
Save