From 80232c35a94d26ae51df5d9895add4439b2bba0b Mon Sep 17 00:00:00 2001 From: wang1007152140 <1007152140@qq.com> Date: Mon, 1 Feb 2021 14:06:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=89=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tcm/api/ConferenceRecordsController.java | 3 ++ .../com/ccsens/tcm/api/PatientController.java | 25 +++++++++---- .../com/ccsens/tcm/bean/dto/PatientDto.java | 37 ++++++++++++++++++- .../ccsens/tcm/persist/dao/PatientDao.java | 2 + .../ccsens/tcm/service/IPatientService.java | 7 ++++ .../ccsens/tcm/service/PatientService.java | 32 +++++++++++++++- .../main/resources/mapper_dao/PatientDao.xml | 26 +++++++++++++ 7 files changed, 122 insertions(+), 10 deletions(-) diff --git a/tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java b/tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java index 512fd40a..bac81856 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java +++ b/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:根据会议记录查询条件查询会议记录") diff --git a/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java b/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java index caa439d5..8335267a 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java +++ b/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> selPatientInformationList(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("查询患者基本信息:{}",params); + PageInfo 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> selSearchCriteriaList() { -// List selSearchCriteriaList= patientService.selSearchCriteriaList(params.getParam(),0L); -// log.info("通过查询搜索条件"); -// return JsonResponse.newInstance().ok(selSearchCriteriaList); - return null; + public JsonResponse> selSearchCriteriaList() { + List selSearchCriteriaList= patientService.selSearchCriteriaList(); + log.info("通过查询搜索条件"); + return JsonResponse.newInstance().ok(selSearchCriteriaList); } } diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java b/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java index 78a1c1a5..0e40656b 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java +++ b/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("搜索条件集合,不包含时间格式的条件") diff --git a/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java b/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java index 906055a5..54f3154a 100644 --- a/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java +++ b/tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java @@ -16,4 +16,6 @@ public interface PatientDao { List selConRec(ConRecDto.SelConRecDto param); List selPatientMesList(PatientDto.SelPatlenConditionList param); + + List selPatientInformationList(PatientDto.SelPatientList param); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java index 18df6b99..4752d1c1 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java +++ b/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 selConRec(ConRecDto.SelConRecDto param, Long userId); PageInfo selPatientMesList(PatientDto.SelPatlenConditionList param, long l); + + List selSearchCriteriaList(); + + PageInfo selPatientInformationList(PatientDto.SelPatientList param, Long userId); } diff --git a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java index 6b6aa58a..c774cdbb 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java +++ b/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 patientRecordList = patientRecordMapper.selectByExample(patientRecordExample1); @@ -167,6 +170,33 @@ public class PatientService implements IPatientService { return new PageInfo<>(selPatientLists); } + @Override + public List selSearchCriteriaList() { + List objects = redisUtil.lGet(Constant.Redis.CODE_QUESTION, 0, -1); + List reportCodeVos = (List)objects.get(0); + for (int i = 0; i < reportCodeVos.size(); i++) { + List 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 selPatientInformationList(PatientDto.SelPatientList param, Long userId) { + PageHelper.startPage(param.getPageNum(),param.getPageSize()); + List selPatientList= patientDao.selPatientInformationList(param); + return new PageInfo<>(selPatientList); + } + /** * 换算时间差 ,返回两个时间 之间差几天,要是小于1天,按照1的算,要是大于1的话,小于2的话,说的是秒啊。按照2的算,进一法啊 * @param bigDate 大时间 diff --git a/tcm/src/main/resources/mapper_dao/PatientDao.xml b/tcm/src/main/resources/mapper_dao/PatientDao.xml index fbb95515..060352d3 100644 --- a/tcm/src/main/resources/mapper_dao/PatientDao.xml +++ b/tcm/src/main/resources/mapper_dao/PatientDao.xml @@ -81,4 +81,30 @@ ) t ) + \ No newline at end of file