Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zy_Java 5 years ago
parent
commit
f82a13b2ca
  1. 7
      tcm/src/main/java/com/ccsens/tcm/api/ConferenceRecordsController.java
  2. 26
      tcm/src/main/java/com/ccsens/tcm/api/PatientController.java
  3. 44
      tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java
  4. 41
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  5. 25
      tcm/src/main/java/com/ccsens/tcm/bean/dto/StatisticDto.java
  6. 8
      tcm/src/main/java/com/ccsens/tcm/bean/vo/PatientVo.java
  7. 31
      tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java
  8. 7
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  9. 11
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  10. 51
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  11. 57
      tcm/src/main/resources/mapper_dao/PatientDao.xml
  12. 1
      util/src/main/java/com/ccsens/util/CodeEnum.java

7
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,13 +27,14 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/conferenceRecords")
@Slf4j
public class ConferenceRecordsController {
@Resource
private IPatientService patientService;
// @MustLogin
@MustLogin
@ApiOperation(value = "查询会议记录", notes = "w:根据会议记录查询条件查询会议记录")
@RequestMapping(value = "/selConRec", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<ConRecVo.SelConRecVo>> selConRec(@ApiParam @Validated @RequestBody QueryDto<ConRecDto.SelConRecDto> params) {
log.info("查询会议记录相关信息:{}",params);
PageInfo<ConRecVo.SelConRecVo> selConRecVoPageInfo= patientService.selConRec(params.getParam(),0L);
PageInfo<ConRecVo.SelConRecVo> selConRecVoPageInfo= patientService.selConRec(params.getParam(),params.getUserId());
log.info("查询会议记录基本信息成功");
return JsonResponse.newInstance().ok(selConRecVoPageInfo);
}

26
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,14 +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);
}
}

44
tcm/src/main/java/com/ccsens/tcm/api/StatisticalAnalysisController.java

@ -0,0 +1,44 @@
package com.ccsens.tcm.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.tcm.bean.dto.ConRecDto;
import com.ccsens.tcm.bean.dto.StatisticDto;
import com.ccsens.tcm.bean.vo.ConRecVo;
import com.ccsens.tcm.bean.vo.StatisticVo;
import com.ccsens.tcm.service.IPatientService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
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
*/
@Api(tags = "统计分析相关接口")
@RestController
@RequestMapping("/statistics")
@Slf4j
public class StatisticalAnalysisController {
@Resource
private IPatientService patientService;
@MustLogin
@ApiOperation(value = "每日病例统计", notes = "w:每日病例统计")
@RequestMapping(value = "/countCase", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<StatisticVo.SelCountS> countCase(@ApiParam @Validated @RequestBody QueryDto<StatisticDto.SelCount> params) {
log.info("统计每日病例请求参数:{}",params);
StatisticVo.SelCountS countCase= patientService.countCase(params.getParam(),params.getUserId());
log.info("统计每日病例调用完成");
return JsonResponse.newInstance().ok(countCase);
}
}

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

@ -22,11 +22,30 @@ public class PatientDto {
@ApiModelProperty("住院号")
private String hospitalization;
@ApiModelProperty("对照组id")
private Integer inpatientId;
private Long inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")
private Byte inputStatus;
private Byte inputStatus=0;
@ApiModelProperty("医院id")
private Integer hospitalId;
private Long hospitalId;
}
@Data
@ApiModel("查询患者基本信息")
public static class SelPatientList {
@ApiModelProperty("病患id")
private Long id;
@ApiModelProperty("住院号")
private String hospitalization;
@ApiModelProperty("对照组id")
private Long 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
@ -47,11 +66,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 Long inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")
private Byte inputStatus;
@ApiModelProperty("医院id")
private Long hospitalId;
}
@Data
@ApiModel("查询患者的搜索条件集合")
public static class SelPatlenConditionList{
@ApiModelProperty("搜索条件集合,不包含时间格式的条件")

25
tcm/src/main/java/com/ccsens/tcm/bean/dto/StatisticDto.java

@ -0,0 +1,25 @@
package com.ccsens.tcm.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
public class StatisticDto {
@Data
public static class SelCount{
@ApiModelProperty("主治大夫id")
private Long userId;
@ApiModelProperty("医院id")
private Long hospitalId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("开始时间")
private Date startDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("结束时间")
private Date endDate;
}
}

8
tcm/src/main/java/com/ccsens/tcm/bean/vo/PatientVo.java

@ -22,11 +22,15 @@ public class PatientVo {
@ApiModelProperty("住院号")
private String hospitalization;
@ApiModelProperty("对照组id")
private Integer inpatientId;
private Long inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")
private Byte inputStatus;
@ApiModelProperty("医院id")
private Integer hospitalId;
private Long hospitalId;
@ApiModelProperty("对照组名称")
private String name;
@ApiModelProperty("搜集次数")
private Integer collectionNum;
}
@Data
@ApiModel("经过搜索条件查询的患者集合")

31
tcm/src/main/java/com/ccsens/tcm/bean/vo/StatisticVo.java

@ -0,0 +1,31 @@
package com.ccsens.tcm.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class StatisticVo {
@Data
@ApiModel("每日分析数量统计")
public static class SelCountS{
@ApiModelProperty("新建的病例")
private Integer newNums;
@ApiModelProperty("已完成的病例")
private Integer overNums;
}
@Data
@ApiModel("病例分析")
public static class SelGroupNum{
private Long inpatientId;
private List<SelGroupList> list;
}
@Data
@ApiModel("病例分析详细数量")
public static class SelGroupList{
private String contents;
private Integer nums;
}
}

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

@ -2,8 +2,11 @@ package com.ccsens.tcm.persist.dao;
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.vo.ConRecVo;
import com.ccsens.tcm.bean.vo.PatientVo;
import com.ccsens.tcm.bean.vo.StatisticVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -16,4 +19,8 @@ public interface PatientDao {
List<ConRecVo.SelConRecVo> selConRec(ConRecDto.SelConRecDto param);
List<PatientVo.SelPatient> selPatientMesList(PatientDto.SelPatlenConditionList param);
List<PatientVo.SelPatient> selPatientInformationList(PatientDto.SelPatientList param);
Integer countCase(@Param("param") StatisticDto.SelCount param,@Param("inputStatus") byte inputStatus);
}

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

@ -2,10 +2,15 @@ package com.ccsens.tcm.service;
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.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.github.pagehelper.PageInfo;
import java.util.List;
/**
* @author wang
*/
@ -17,4 +22,10 @@ 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);
StatisticVo.SelCountS countCase(StatisticDto.SelCount param, Long userId);
}

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

@ -1,19 +1,26 @@
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;
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;
@ -56,7 +63,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);
@ -76,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;
@ -167,6 +175,45 @@ public class PatientService implements IPatientService {
return new PageInfo<>(selPatientLists);
}
@Override
public List<QuestionVo.ReportCodeVo> selSearchCriteriaList() {
List<QuestionVo.ReportCodeVo> reportCodeVos=null;
List<Object> objects = redisUtil.lGet(Constant.Redis.CODE_QUESTION, 0, -1);
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;
}
@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);
}
@Override
public StatisticVo.SelCountS countCase(StatisticDto.SelCount param, Long userId) {
StatisticVo.SelCountS selCountS=new StatisticVo.SelCountS();
selCountS.setNewNums(patientDao.countCase(param,(byte)0));
selCountS.setOverNums(patientDao.countCase(param,(byte)0));
return selCountS;
}
/**
* 换算时间差 返回两个时间 之间差几天要是小于1天按照1的算要是大于1的话小于2的话说的是秒啊按照2的算,进一法啊
* @param bigDate 大时间

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

@ -39,13 +39,15 @@
</select>
<select id="selPatientMesList" resultType="com.ccsens.tcm.bean.vo.PatientVo$SelPatient">
SELECT
id,
hospitalization,
tpi.id,
tpi.hospitalization,
tpi.inpatient_id AS inpatientId,
tpi.input_status AS inputStatus,
tpi.hospital_id AS hospitalId
tpi.hospital_id AS hospitalId,
ti.name,
ti.collection_num as collectionNum
FROM
t_patient_information tpi
t_patient_information tpi left join t_inpatient ti on ti.rec_status=0 and ti.id=tpi.inpatient_id
WHERE
tpi.rec_status = 0
AND tpi.id IN (
@ -81,4 +83,51 @@
) 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,
ti.name,
ti.collection_num as collectionNum
FROM
t_patient_information tpi left join t_inpatient ti on ti.rec_status=0 and ti.id=tpi.inpatient_id
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>
<select id="countCase" resultType="java.lang.Integer">
select count(*) as nums from t_patient_information tpi
where tpi.rec_status=0
<if test="param.userId!=null">
and tpi.user_id=#{param.userId}
</if>
<if test="param.hospitalId!=null">
and tpi.hospital_id=#{param.hospitalId}
</if>
<if test="inputStatus!=null">
and tpi.input_status=#{inputStatus}
</if>
<if test="param.startDate!=null">
and tpi.update_at &gt; #{param.startDate}
</if>
<if test="param.endDate!=null">
and tpi.update_at &lt; #{param.endDate}
</if>
</select>
</mapper>

1
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -180,6 +180,7 @@ public enum CodeEnum {
ALREADY_JOIN_PROJECT_DEL(149,"取消报名后可删除",true),
ALREADY_UPLOAD_VIDEO(150,"您已经上传了视频,请勿重复提交",true),
ALREADY_UPLOAD_FORM(151,"请勿重复提交信息",true),
MESSAGEISNULL(152,"数据为空",true),
;

Loading…
Cancel
Save