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 42763885..30ffed45 100644 --- a/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java +++ b/tcm/src/main/java/com/ccsens/tcm/api/PatientController.java @@ -26,13 +26,24 @@ public class PatientController { // disease_time private IPatientService patientService; + @MustLogin - @ApiOperation(value = "添加患者基本信息", notes = "zy:添加一个活动公告,本平台默认审核通过") + @ApiOperation(value = "添加患者基本信息", notes = "w:添加患者基本信息") @RequestMapping(value = "/savePatientMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse saveActivity(@ApiParam @Validated @RequestBody QueryDto params) { log.info("添加患者基本信息:{}",params); patientService.savePatient(params.getParam(),params.getUserId()); - log.info("添加患者基本成功"); + log.info("添加患者基本信息成功"); return JsonResponse.newInstance().ok(); } + @MustLogin + @ApiOperation(value = "保存患者病例信息", notes = "w:提交患者的相关病例信息") + @RequestMapping(value = "/saveCaseMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse saveCaseMes(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("添加患者病例信息:{}",params); + patientService.saveCaseMes(params.getParam(),params.getUserId()); + log.info("添加患者病例信息成功"); + return JsonResponse.newInstance().ok(); + } + } 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 46ccf820..2eb66960 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 @@ -1,11 +1,13 @@ package com.ccsens.tcm.bean.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import sun.awt.ConstrainableGraphics; import java.util.Date; +import java.util.List; /** * @author wang @@ -24,4 +26,24 @@ public class PatientDto { @ApiModelProperty("医院id") private Integer hospitalId; } + + @Data + @ApiModel("保存患者的多个病例信息") + public static class saveCaseMes { + List list; + } + + @Data + @ApiModel("患者的某个病例信息") + public static class saveCaseMesSig { + @ApiModelProperty("患者id") + private Long patientId; + @ApiModelProperty("问题id") + private Long testQuestionsId; + @ApiModelProperty("内容") + private String contents; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("诊断时间") + private Date timeSlot; + } } diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java index 1185518c..08334c78 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java @@ -6,9 +6,9 @@ import java.util.Date; public class patientRecord implements Serializable { private Long id; - private Integer patientId; + private Long patientId; - private Integer testQuestionsId; + private Long testQuestionsId; private String contents; @@ -34,19 +34,19 @@ public class patientRecord implements Serializable { this.id = id; } - public Integer getPatientId() { + public Long getPatientId() { return patientId; } - public void setPatientId(Integer patientId) { + public void setPatientId(Long patientId) { this.patientId = patientId; } - public Integer getTestQuestionsId() { + public Long getTestQuestionsId() { return testQuestionsId; } - public void setTestQuestionsId(Integer testQuestionsId) { + public void setTestQuestionsId(Long testQuestionsId) { this.testQuestionsId = testQuestionsId; } diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java index d5ba2190..040b35cb 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java @@ -175,52 +175,52 @@ public class patientRecordExample { return (Criteria) this; } - public Criteria andPatientIdEqualTo(Integer value) { + public Criteria andPatientIdEqualTo(Long value) { addCriterion("patient_id =", value, "patientId"); return (Criteria) this; } - public Criteria andPatientIdNotEqualTo(Integer value) { + public Criteria andPatientIdNotEqualTo(Long value) { addCriterion("patient_id <>", value, "patientId"); return (Criteria) this; } - public Criteria andPatientIdGreaterThan(Integer value) { + public Criteria andPatientIdGreaterThan(Long value) { addCriterion("patient_id >", value, "patientId"); return (Criteria) this; } - public Criteria andPatientIdGreaterThanOrEqualTo(Integer value) { + public Criteria andPatientIdGreaterThanOrEqualTo(Long value) { addCriterion("patient_id >=", value, "patientId"); return (Criteria) this; } - public Criteria andPatientIdLessThan(Integer value) { + public Criteria andPatientIdLessThan(Long value) { addCriterion("patient_id <", value, "patientId"); return (Criteria) this; } - public Criteria andPatientIdLessThanOrEqualTo(Integer value) { + public Criteria andPatientIdLessThanOrEqualTo(Long value) { addCriterion("patient_id <=", value, "patientId"); return (Criteria) this; } - public Criteria andPatientIdIn(List values) { + public Criteria andPatientIdIn(List values) { addCriterion("patient_id in", values, "patientId"); return (Criteria) this; } - public Criteria andPatientIdNotIn(List values) { + public Criteria andPatientIdNotIn(List values) { addCriterion("patient_id not in", values, "patientId"); return (Criteria) this; } - public Criteria andPatientIdBetween(Integer value1, Integer value2) { + public Criteria andPatientIdBetween(Long value1, Long value2) { addCriterion("patient_id between", value1, value2, "patientId"); return (Criteria) this; } - public Criteria andPatientIdNotBetween(Integer value1, Integer value2) { + public Criteria andPatientIdNotBetween(Long value1, Long value2) { addCriterion("patient_id not between", value1, value2, "patientId"); return (Criteria) this; } @@ -235,52 +235,52 @@ public class patientRecordExample { return (Criteria) this; } - public Criteria andTestQuestionsIdEqualTo(Integer value) { + public Criteria andTestQuestionsIdEqualTo(Long value) { addCriterion("test_questions_id =", value, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdNotEqualTo(Integer value) { + public Criteria andTestQuestionsIdNotEqualTo(Long value) { addCriterion("test_questions_id <>", value, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdGreaterThan(Integer value) { + public Criteria andTestQuestionsIdGreaterThan(Long value) { addCriterion("test_questions_id >", value, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdGreaterThanOrEqualTo(Integer value) { + public Criteria andTestQuestionsIdGreaterThanOrEqualTo(Long value) { addCriterion("test_questions_id >=", value, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdLessThan(Integer value) { + public Criteria andTestQuestionsIdLessThan(Long value) { addCriterion("test_questions_id <", value, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdLessThanOrEqualTo(Integer value) { + public Criteria andTestQuestionsIdLessThanOrEqualTo(Long value) { addCriterion("test_questions_id <=", value, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdIn(List values) { + public Criteria andTestQuestionsIdIn(List values) { addCriterion("test_questions_id in", values, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdNotIn(List values) { + public Criteria andTestQuestionsIdNotIn(List values) { addCriterion("test_questions_id not in", values, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdBetween(Integer value1, Integer value2) { + public Criteria andTestQuestionsIdBetween(Long value1, Long value2) { addCriterion("test_questions_id between", value1, value2, "testQuestionsId"); return (Criteria) this; } - public Criteria andTestQuestionsIdNotBetween(Integer value1, Integer value2) { + public Criteria andTestQuestionsIdNotBetween(Long value1, Long value2) { addCriterion("test_questions_id not between", value1, value2, "testQuestionsId"); return (Criteria) this; } 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 2c8ded0b..867d03cb 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java @@ -7,4 +7,6 @@ import com.ccsens.tcm.bean.dto.PatientDto; */ public interface IPatientService { void savePatient(PatientDto.SavePatient param, Long userId); + + void saveCaseMes(PatientDto.saveCaseMes 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 9176cef6..5243def3 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java @@ -4,6 +4,8 @@ import cn.hutool.core.lang.Snowflake; import com.ccsens.tcm.bean.dto.PatientDto; import com.ccsens.tcm.bean.po.PatientInformation; import com.ccsens.tcm.persist.mapper.PatientInformationMapper; +import com.ccsens.tcm.persist.mapper.ReportCodeMapper; +import com.ccsens.util.RedisUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -20,6 +22,10 @@ public class PatientService implements IPatientService { private PatientInformationMapper patientInformationMapper; @Resource private Snowflake snowflake; + @Resource + private RedisUtil redisUtil; + @Resource + private ReportCodeMapper reportCodeMapper; @Override public void savePatient(PatientDto.SavePatient param, Long userId) { @@ -28,4 +34,18 @@ public class PatientService implements IPatientService { patientInformation.setId(snowflake.nextId()); patientInformationMapper.insertSelective(patientInformation); } + + @Override + public void saveCaseMes(PatientDto.saveCaseMes param, Long userId) { + Integer.parseInt((String) redisUtil.get("disease_time")); + if(param.getList().size()>0) { + for (int i = 0; i < param.getList().size(); i++) { + //先查询试题id + reportCodeMapper.selectByPrimaryKey(param.getList().get(i).getTestQuestionsId()); + + } + + + } + } } diff --git a/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml b/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml index bc6b0c7b..6acc2872 100644 --- a/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml +++ b/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml @@ -3,8 +3,8 @@ - - + + @@ -113,7 +113,7 @@ user_id, collect_time, time_slot, created_at, update_at, rec_status ) - values (#{patientId,jdbcType=INTEGER}, #{testQuestionsId,jdbcType=INTEGER}, #{contents,jdbcType=VARCHAR}, + values (#{patientId,jdbcType=BIGINT}, #{testQuestionsId,jdbcType=BIGINT}, #{contents,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{collectTime,jdbcType=INTEGER}, #{timeSlot,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} ) @@ -154,10 +154,10 @@ - #{patientId,jdbcType=INTEGER}, + #{patientId,jdbcType=BIGINT}, - #{testQuestionsId,jdbcType=INTEGER}, + #{testQuestionsId,jdbcType=BIGINT}, #{contents,jdbcType=VARCHAR}, @@ -195,10 +195,10 @@ id = #{record.id,jdbcType=BIGINT}, - patient_id = #{record.patientId,jdbcType=INTEGER}, + patient_id = #{record.patientId,jdbcType=BIGINT}, - test_questions_id = #{record.testQuestionsId,jdbcType=INTEGER}, + test_questions_id = #{record.testQuestionsId,jdbcType=BIGINT}, contents = #{record.contents,jdbcType=VARCHAR}, @@ -229,8 +229,8 @@ update t_patient_record set id = #{record.id,jdbcType=BIGINT}, - patient_id = #{record.patientId,jdbcType=INTEGER}, - test_questions_id = #{record.testQuestionsId,jdbcType=INTEGER}, + patient_id = #{record.patientId,jdbcType=BIGINT}, + test_questions_id = #{record.testQuestionsId,jdbcType=BIGINT}, contents = #{record.contents,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=BIGINT}, collect_time = #{record.collectTime,jdbcType=INTEGER}, @@ -246,10 +246,10 @@ update t_patient_record - patient_id = #{patientId,jdbcType=INTEGER}, + patient_id = #{patientId,jdbcType=BIGINT}, - test_questions_id = #{testQuestionsId,jdbcType=INTEGER}, + test_questions_id = #{testQuestionsId,jdbcType=BIGINT}, contents = #{contents,jdbcType=VARCHAR}, @@ -277,8 +277,8 @@ update t_patient_record - set patient_id = #{patientId,jdbcType=INTEGER}, - test_questions_id = #{testQuestionsId,jdbcType=INTEGER}, + set patient_id = #{patientId,jdbcType=BIGINT}, + test_questions_id = #{testQuestionsId,jdbcType=BIGINT}, contents = #{contents,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=BIGINT}, collect_time = #{collectTime,jdbcType=INTEGER},