Commit 441c8fe144becae0cd5bfcd338997ab517e56fce
1 parent
f84d3505e2
Exists in
dev
营养检测部门源码+病例上传疾病名称显示原名称修改
Showing 24 changed files with 966 additions and 66 deletions
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/YyscArchiveController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/BaseRecordAnswer.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsXljcRecordAnswer.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsYyscArchive.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsYyscRecord.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsYyscRecordAnswer.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsYyscArchiveMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsYyscRecordAnswerMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsYyscRecordMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/request/XljcAnswerVO.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/request/YyscExamineRequest.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsYyscArchiveService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsYyscRecordAnswerService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsYyscRecordService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsXljcRecordServiceImpl.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsYyscArchiveServiceImpl.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsYyscRecordAnswerServiceImpl.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsYyscRecordServiceImpl.java
- talkonlineweb/src/main/resources/mapper/LymsXljcRecordAnswerMapper.xml
- talkonlineweb/src/main/resources/mapper/LymsYyscArchiveMapper.xml
- talkonlineweb/src/main/resources/mapper/LymsYyscRecordAnswerMapper.xml
- talkonlineweb/src/main/resources/mapper/LymsYyscRecordMapper.xml
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
View file @
441c8fe
| ... | ... | @@ -546,11 +546,11 @@ |
| 546 | 546 | List<LymsIllness> lymsIllnessList=lymsIllnessService.list(wrapperLymsIllness); |
| 547 | 547 | String inames=""; |
| 548 | 548 | for (LymsIllness lymsIllness : lymsIllnessList) { |
| 549 | - LambdaQueryWrapper<LymsDict> wrapperLymsDict2 = new QueryWrapper().lambda(); | |
| 549 | + /*LambdaQueryWrapper<LymsDict> wrapperLymsDict2 = new QueryWrapper().lambda(); | |
| 550 | 550 | wrapperLymsDict2.eq(LymsDict::getVtype, 3); |
| 551 | 551 | wrapperLymsDict2.eq(LymsDict::getCode,lymsIllness.getIid()); |
| 552 | - LymsDict dict2=lymsDictService.getOne(wrapperLymsDict2); | |
| 553 | - inames+=dict2.getValue()+","; | |
| 552 | + LymsDict dict2=lymsDictService.getOne(wrapperLymsDict2);*/ | |
| 553 | + inames += lymsIllness.getIname()+","; | |
| 554 | 554 | } |
| 555 | 555 | result.setIname(StringUtil.isNotEmpty(inames)?inames.substring(0, inames.length()-1):""); |
| 556 | 556 | //获得医生环信账号 |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/YyscArchiveController.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.controller; | |
| 2 | + | |
| 3 | +import cn.afterturn.easypoi.excel.ExcelExportUtil; | |
| 4 | +import cn.afterturn.easypoi.excel.entity.ExportParams; | |
| 5 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
| 7 | +import com.lyms.talkonlineweb.annotation.TokenRequired; | |
| 8 | +import com.lyms.talkonlineweb.domain.LymsDoctor; | |
| 9 | +import com.lyms.talkonlineweb.domain.LymsUser; | |
| 10 | +import com.lyms.talkonlineweb.domain.LymsXljcArchive; | |
| 11 | +import com.lyms.talkonlineweb.domain.LymsYyscArchive; | |
| 12 | +import com.lyms.talkonlineweb.param.ArchiveParam; | |
| 13 | +import com.lyms.talkonlineweb.result.BaseResponse; | |
| 14 | +import com.lyms.talkonlineweb.service.LymsDoctorService; | |
| 15 | +import com.lyms.talkonlineweb.service.LymsUserService; | |
| 16 | +import com.lyms.talkonlineweb.service.LymsXljcArchiveService; | |
| 17 | +import com.lyms.talkonlineweb.service.LymsYyscArchiveService; | |
| 18 | +import com.lyms.talkonlineweb.util.BeanUtils; | |
| 19 | +import com.lyms.talkonlineweb.util.DateUtil; | |
| 20 | +import com.lyms.talkonlineweb.util.StringUtil; | |
| 21 | +import org.apache.poi.ss.usermodel.Workbook; | |
| 22 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 23 | +import org.springframework.validation.BindingResult; | |
| 24 | +import org.springframework.validation.annotation.Validated; | |
| 25 | +import org.springframework.web.bind.annotation.*; | |
| 26 | + | |
| 27 | +import javax.servlet.ServletOutputStream; | |
| 28 | +import javax.servlet.http.HttpServletResponse; | |
| 29 | +import java.net.URLEncoder; | |
| 30 | +import java.util.Date; | |
| 31 | +import java.util.List; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * 营养筛查档案管理 | |
| 35 | + * 档案管理已医院为维度,各种操作需要增加当前操作人员的所属医院条件 | |
| 36 | + */ | |
| 37 | + | |
| 38 | +@RestController | |
| 39 | +@RequestMapping("yysc/archive") | |
| 40 | +public class YyscArchiveController { | |
| 41 | + | |
| 42 | + @Autowired | |
| 43 | + private LymsYyscArchiveService lymsYyscArchiveService; | |
| 44 | + | |
| 45 | + @Autowired | |
| 46 | + private LymsUserService lymsUserService; | |
| 47 | + | |
| 48 | + @Autowired | |
| 49 | + private LymsDoctorService lymsDoctorService; | |
| 50 | + | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 档案新增 | |
| 54 | + * @param archive | |
| 55 | + * @param result | |
| 56 | + * @param authorization | |
| 57 | + * @return | |
| 58 | + */ | |
| 59 | + @PostMapping | |
| 60 | + @TokenRequired | |
| 61 | + public BaseResponse saveArchive(@RequestBody @Validated LymsYyscArchive archive, BindingResult result, @RequestHeader String authorization){ | |
| 62 | + LymsUser curUser=lymsUserService.getUserByToken(authorization); | |
| 63 | + if(curUser.getDoctorId() == null){ | |
| 64 | + return BaseResponse.error("当前账号无法新建档案,请绑定医生"); | |
| 65 | + } | |
| 66 | + //身份证号转小写 | |
| 67 | + archive.setIdno(archive.getIdno().toLowerCase()); | |
| 68 | + QueryWrapper<LymsYyscArchive> query = new QueryWrapper<>(); | |
| 69 | + query.eq("idno",archive.getIdno()); | |
| 70 | + query.eq("hid",curUser.getHid()); | |
| 71 | + LymsYyscArchive yyscArchive = lymsYyscArchiveService.getOne(query); | |
| 72 | + if(yyscArchive != null){ | |
| 73 | + return BaseResponse.error("该身份证号对应的档案已经在该医院存在"); | |
| 74 | + } | |
| 75 | + if(result.hasErrors()){ | |
| 76 | + BaseResponse baseResponse = new BaseResponse(); | |
| 77 | + result.getAllErrors().forEach(e->{ | |
| 78 | + baseResponse.setErrormsg(baseResponse.getErrormsg()+e.getDefaultMessage()+";"); | |
| 79 | + }); | |
| 80 | + baseResponse.setErrorcode(1); | |
| 81 | + return baseResponse; | |
| 82 | + } | |
| 83 | + | |
| 84 | + LymsDoctor lymsDoctor = lymsDoctorService.getById(archive.getBookbuilDoctor()); | |
| 85 | + archive.setHid(lymsDoctor.getHid()); | |
| 86 | + archive.setDpid(lymsDoctor.getDpid()); | |
| 87 | + archive.setAge(DateUtil.getAge(DateUtil.parseYMD(archive.getBirth()))); | |
| 88 | + archive.setCreatedby(curUser.getUid()); | |
| 89 | + archive.setCreatedtime(new Date()); | |
| 90 | + lymsYyscArchiveService.save(archive); | |
| 91 | + | |
| 92 | + return BaseResponse.ok(); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @PutMapping | |
| 96 | + @TokenRequired | |
| 97 | + public BaseResponse updateArchive(@RequestBody @Validated LymsYyscArchive archive,BindingResult result,@RequestHeader String authorization){ | |
| 98 | + LymsUser curUser=lymsUserService.getUserByToken(authorization); | |
| 99 | + if(curUser.getDoctorId() == null){ | |
| 100 | + return BaseResponse.error("当前账号无法更新档案,请绑定医生"); | |
| 101 | + } | |
| 102 | + //身份证号转小写 | |
| 103 | + archive.setIdno(archive.getIdno().toLowerCase()); | |
| 104 | + QueryWrapper<LymsYyscArchive> query = new QueryWrapper<>(); | |
| 105 | + query.eq("idno",archive.getIdno()); | |
| 106 | + query.eq("hid",curUser.getHid()); | |
| 107 | + LymsYyscArchive yyscArchive = lymsYyscArchiveService.getOne(query); | |
| 108 | + if(yyscArchive != null && yyscArchive.getId() != archive.getId()){ | |
| 109 | + return BaseResponse.error("该身份证号对应的档案已经存在"); | |
| 110 | + } | |
| 111 | + | |
| 112 | + if(result.hasErrors()){ | |
| 113 | + BaseResponse baseResponse = new BaseResponse(); | |
| 114 | + result.getAllErrors().forEach(e->{ | |
| 115 | + baseResponse.setErrormsg(baseResponse.getErrormsg()+e.getDefaultMessage()+";"); | |
| 116 | + }); | |
| 117 | + baseResponse.setErrorcode(1); | |
| 118 | + return baseResponse; | |
| 119 | + } | |
| 120 | + LymsDoctor lymsDoctor = lymsDoctorService.getById(archive.getBookbuilDoctor()); | |
| 121 | + archive.setHid(lymsDoctor.getHid()); | |
| 122 | + archive.setDpid(lymsDoctor.getDpid()); | |
| 123 | + archive.setAge(DateUtil.getAge(DateUtil.parseYMD(archive.getBirth()))); | |
| 124 | + archive.setUpdatedby(curUser.getUid()); | |
| 125 | + archive.setUpdatedtime(new Date()); | |
| 126 | + lymsYyscArchiveService.updateById(archive); | |
| 127 | + | |
| 128 | + return BaseResponse.ok(); | |
| 129 | + } | |
| 130 | + | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * 根据身份证号查询档案 | |
| 134 | + * @param idno | |
| 135 | + * @return | |
| 136 | + */ | |
| 137 | + @GetMapping("/{idno}") | |
| 138 | + @TokenRequired | |
| 139 | + public BaseResponse archiveByIdno(@PathVariable("idno") String idno,@RequestHeader String authorization){ | |
| 140 | + LymsUser curUser=lymsUserService.getUserByToken(authorization); | |
| 141 | + QueryWrapper<LymsYyscArchive> query = new QueryWrapper<>(); | |
| 142 | + query.eq("idno",idno); | |
| 143 | + query.eq("hid",curUser.getHid()); | |
| 144 | + LymsYyscArchive yyscArchive = lymsYyscArchiveService.getOne(query); | |
| 145 | + if(yyscArchive == null){ | |
| 146 | + return BaseResponse.error("未查询到该身份证证号对应的档案,请先建立档案"); | |
| 147 | + } | |
| 148 | + yyscArchive.setSexName(BeanUtils.tranferSexToText(yyscArchive.getSex())); | |
| 149 | + yyscArchive.setAge(DateUtil.getAge(DateUtil.parseYMD(yyscArchive.getBirth()))); | |
| 150 | + return BaseResponse.ok(yyscArchive); | |
| 151 | + } | |
| 152 | + | |
| 153 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/BaseRecordAnswer.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.io.Serializable; | |
| 7 | + | |
| 8 | +@Data | |
| 9 | +public class BaseRecordAnswer implements Serializable { | |
| 10 | + | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * 检测记录ID | |
| 14 | + */ | |
| 15 | + @TableField(value = "rid") | |
| 16 | + private Integer rid; | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 问题分组 | |
| 20 | + */ | |
| 21 | + @TableField(value = "type_label") | |
| 22 | + private String typeLabel; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 问题序号 | |
| 26 | + */ | |
| 27 | + @TableField(value = "question_id") | |
| 28 | + private String questionId; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 问题答案 | |
| 32 | + */ | |
| 33 | + @TableField(value = "question_answer") | |
| 34 | + private String questionAnswer; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 问题名称,只有是其他是才有职位 | |
| 38 | + */ | |
| 39 | + @TableField(value = "question_label") | |
| 40 | + private String questionLabel; | |
| 41 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsXljcRecordAnswer.java
View file @
441c8fe
| ... | ... | @@ -14,44 +14,13 @@ |
| 14 | 14 | */ |
| 15 | 15 | @TableName(value ="lyms_xljc_record_answer") |
| 16 | 16 | @Data |
| 17 | -public class LymsXljcRecordAnswer implements Serializable { | |
| 17 | +public class LymsXljcRecordAnswer extends BaseRecordAnswer implements Serializable { | |
| 18 | 18 | |
| 19 | - | |
| 20 | 19 | /** |
| 21 | 20 | * id |
| 22 | 21 | */ |
| 23 | 22 | @TableId(value = "id", type = IdType.AUTO) |
| 24 | 23 | private Integer id; |
| 25 | - | |
| 26 | - /** | |
| 27 | - * 检测记录ID | |
| 28 | - */ | |
| 29 | - @TableField(value = "rid") | |
| 30 | - private Integer rid; | |
| 31 | - | |
| 32 | - /** | |
| 33 | - * 问题分组 | |
| 34 | - */ | |
| 35 | - @TableField(value = "type_label") | |
| 36 | - private String typeLabel; | |
| 37 | - | |
| 38 | - /** | |
| 39 | - * 问题序号 | |
| 40 | - */ | |
| 41 | - @TableField(value = "question_id") | |
| 42 | - private String questionId; | |
| 43 | - | |
| 44 | - /** | |
| 45 | - * 问题答案 | |
| 46 | - */ | |
| 47 | - @TableField(value = "question_answer") | |
| 48 | - private String questionAnswer; | |
| 49 | - | |
| 50 | - /** | |
| 51 | - * 问题名称,只有是其他是才有职位 | |
| 52 | - */ | |
| 53 | - @TableField(value = "question_label") | |
| 54 | - private String questionLabel; | |
| 55 | 24 | |
| 56 | 25 | |
| 57 | 26 | @TableField(value = "createdby") |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsYyscArchive.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.domain; | |
| 2 | + | |
| 3 | +import cn.afterturn.easypoi.excel.annotation.Excel; | |
| 4 | +import cn.afterturn.easypoi.excel.annotation.ExcelTarget; | |
| 5 | +import com.baomidou.mybatisplus.annotation.IdType; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 8 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 9 | +import lombok.Data; | |
| 10 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 11 | + | |
| 12 | +import java.io.Serializable; | |
| 13 | +import java.util.Date; | |
| 14 | + | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * 营养筛查档案 | |
| 18 | + */ | |
| 19 | +@TableName(value ="lyms_yysc_archive") | |
| 20 | +@Data | |
| 21 | +@ExcelTarget("lyms_yysc_archive") | |
| 22 | +public class LymsYyscArchive implements Serializable { | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * id | |
| 26 | + */ | |
| 27 | + @TableId(value = "id", type = IdType.AUTO) | |
| 28 | + private Integer id; | |
| 29 | + | |
| 30 | + @TableField(exist = false) | |
| 31 | + @Excel(name = "序号", width = 10,orderNum = "0") | |
| 32 | + private Integer sequence; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 患者姓名 | |
| 36 | + */ | |
| 37 | + @TableField(value = "pname") | |
| 38 | + @Excel(name = "患者姓名", width = 20,orderNum = "1") | |
| 39 | + private String pname; | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 身份证号 | |
| 43 | + */ | |
| 44 | + @TableField(value = "idno") | |
| 45 | + @Excel(name = "身份证号", width = 30,orderNum = "4") | |
| 46 | + private String idno; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 电话号码 | |
| 50 | + */ | |
| 51 | + @Excel(name = "电话", width = 20,orderNum = "5") | |
| 52 | + @TableField(value = "tel") | |
| 53 | + private String tel; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 生日 | |
| 57 | + */ | |
| 58 | + @TableField(value = "birth") | |
| 59 | + private String birth; | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 年龄 | |
| 63 | + */ | |
| 64 | + @TableField(value = "age") | |
| 65 | + @Excel(name = "年龄", width = 10,orderNum = "2") | |
| 66 | + private Integer age; | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 性别 | |
| 70 | + */ | |
| 71 | + | |
| 72 | + @TableField(value = "sex") | |
| 73 | + private Integer sex; | |
| 74 | + | |
| 75 | + @Excel(name = "性别", width = 10,orderNum = "3") | |
| 76 | + @TableField(exist = false) | |
| 77 | + private String sexName; | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * 民族 | |
| 81 | + */ | |
| 82 | + @TableField(value = "nation") | |
| 83 | + private Integer nation; | |
| 84 | + | |
| 85 | + /** | |
| 86 | + * 职业类别 | |
| 87 | + */ | |
| 88 | + @TableField(value = "job_type") | |
| 89 | + private String jobType; | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 居住地-详细地址 | |
| 93 | + */ | |
| 94 | + @TableField(value = "reside_addres") | |
| 95 | + private String resideAddres; | |
| 96 | + | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 身高 单位CM | |
| 100 | + */ | |
| 101 | + @TableField(value = "height") | |
| 102 | + private Integer height; | |
| 103 | + | |
| 104 | + /** | |
| 105 | + * 体重 单位KG | |
| 106 | + */ | |
| 107 | + @TableField(value = "weight") | |
| 108 | + private Double weight; | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * 建档医生id | |
| 112 | + */ | |
| 113 | + @TableField(value = "bookbuil_doctor") | |
| 114 | + private Integer bookbuilDoctor; | |
| 115 | + /** | |
| 116 | + * 建档医生姓名 | |
| 117 | + */ | |
| 118 | + @TableField(value = "bookbuil_doctor_name") | |
| 119 | + @Excel(name = "建档医生", width = 15,orderNum = "7") | |
| 120 | + private String bookbuilDoctorName; | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * 建档医院id | |
| 124 | + */ | |
| 125 | + @TableField(value = "hid") | |
| 126 | + private Integer hid; | |
| 127 | + | |
| 128 | + /** | |
| 129 | + * 建档医院科室id | |
| 130 | + */ | |
| 131 | + @TableField(value = "dpid") | |
| 132 | + private Integer dpid; | |
| 133 | + | |
| 134 | + /** | |
| 135 | + * 建档日期 | |
| 136 | + */ | |
| 137 | + @TableField(value = "bookbuil_date") | |
| 138 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 139 | + @Excel(name = "建档日期", width = 30,orderNum = "6",format = "yyyy-MM-dd") | |
| 140 | + private Date bookbuilDate; | |
| 141 | + | |
| 142 | + | |
| 143 | + /** | |
| 144 | + * 创建人 | |
| 145 | + */ | |
| 146 | + @TableField(value = "createdby") | |
| 147 | + private Integer createdby; | |
| 148 | + | |
| 149 | + /** | |
| 150 | + * 创建时间 | |
| 151 | + */ | |
| 152 | + @TableField(value = "createdtime") | |
| 153 | + private Date createdtime; | |
| 154 | + | |
| 155 | + /** | |
| 156 | + * 更新人 | |
| 157 | + */ | |
| 158 | + @TableField(value = "updatedby") | |
| 159 | + private Integer updatedby; | |
| 160 | + | |
| 161 | + /** | |
| 162 | + * 更新时间 | |
| 163 | + */ | |
| 164 | + @TableField(value = "updatedtime") | |
| 165 | + private Date updatedtime; | |
| 166 | + | |
| 167 | + | |
| 168 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsYyscRecord.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.io.Serializable; | |
| 10 | +import java.util.Date; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 营养筛查记录 | |
| 14 | + */ | |
| 15 | +@TableName(value ="lyms_yysc_record") | |
| 16 | +@Data | |
| 17 | +public class LymsYyscRecord implements Serializable { | |
| 18 | + | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * id | |
| 22 | + */ | |
| 23 | + @TableId(value = "id", type = IdType.AUTO) | |
| 24 | + private Integer id; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 档案ID | |
| 28 | + */ | |
| 29 | + @TableField(value = "arch_id") | |
| 30 | + private Integer archId; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 量表编码 | |
| 34 | + */ | |
| 35 | + @TableField(value = "form_code") | |
| 36 | + private String formCode; | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 量表版本 | |
| 40 | + */ | |
| 41 | + @TableField(value = "form_version") | |
| 42 | + private String formVersion; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 检测时间 | |
| 46 | + */ | |
| 47 | + @TableField(value = "examine_time") | |
| 48 | + private Date examineTime; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 检测医生ID | |
| 52 | + */ | |
| 53 | + @TableField(value = "examine_doctor") | |
| 54 | + private Integer examineDoctor; | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 检测医生所属医院 | |
| 58 | + */ | |
| 59 | + @TableField(value = "examine_hid") | |
| 60 | + private Integer examineHid; | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 检测医生所属科室 | |
| 64 | + */ | |
| 65 | + @TableField(value = "examine_dpid") | |
| 66 | + private Integer examineDpid; | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 因子分数 | |
| 70 | + */ | |
| 71 | + @TableField(value = "sum_score") | |
| 72 | + private Integer sumScore; | |
| 73 | + | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * 因子分数 | |
| 77 | + */ | |
| 78 | + @TableField(value = "factor_score") | |
| 79 | + private String factorScore; | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * 处理措施 | |
| 83 | + */ | |
| 84 | + @TableField(value = "deal_measure") | |
| 85 | + private String dealMeasure; | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 营养检测风险类型 二级检测才有值 | |
| 89 | + */ | |
| 90 | + @TableField(value = "risk_type") | |
| 91 | + private String riskType; | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * 营养检测风险名称 | |
| 95 | + */ | |
| 96 | + @TableField(value = "risk_name") | |
| 97 | + private String riskName; | |
| 98 | + | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * 上传患者状态 0 未上传 1 已上传 | |
| 102 | + */ | |
| 103 | + @TableField(value = "upload_status") | |
| 104 | + private Integer uploadStatus; | |
| 105 | + | |
| 106 | + /** | |
| 107 | + * 上传时间 | |
| 108 | + */ | |
| 109 | + @TableField(value = "upload_time") | |
| 110 | + private Date uploadTime; | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * 打印状态 0 未打印 1已打印 | |
| 114 | + */ | |
| 115 | + @TableField(value = "print_status") | |
| 116 | + private Integer printStatus; | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * 打印时间 | |
| 120 | + */ | |
| 121 | + @TableField(value = "print_time") | |
| 122 | + private Date printTime; | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * 打印医生 | |
| 126 | + */ | |
| 127 | + @TableField(value = "print_doctor") | |
| 128 | + private Integer printDoctor; | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + @TableField(value = "createdby") | |
| 134 | + private Integer createdby; | |
| 135 | + | |
| 136 | + @TableField(value = "createdtime") | |
| 137 | + private Date createdtime; | |
| 138 | + | |
| 139 | + @TableField(value = "updatedby") | |
| 140 | + private Integer updatedby; | |
| 141 | + | |
| 142 | + | |
| 143 | + @TableField(value = "updatedtime") | |
| 144 | + private Date updatedtime; | |
| 145 | + | |
| 146 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsYyscRecordAnswer.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.io.Serializable; | |
| 10 | +import java.util.Date; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 营养筛查题目答案 | |
| 14 | + */ | |
| 15 | +@TableName(value ="lyms_yysc_record_answer") | |
| 16 | +@Data | |
| 17 | +public class LymsYyscRecordAnswer extends BaseRecordAnswer implements Serializable { | |
| 18 | + | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * id | |
| 22 | + */ | |
| 23 | + @TableId(value = "id", type = IdType.AUTO) | |
| 24 | + private Integer id; | |
| 25 | + | |
| 26 | + @TableField(value = "createdby") | |
| 27 | + private Integer createdby; | |
| 28 | + | |
| 29 | + @TableField(value = "createdtime") | |
| 30 | + private Date createdtime; | |
| 31 | + | |
| 32 | + | |
| 33 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsYyscArchiveMapper.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.mapper; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 4 | +import com.lyms.talkonlineweb.domain.LymsYyscArchive; | |
| 5 | +import org.apache.ibatis.annotations.Mapper; | |
| 6 | + | |
| 7 | +@Mapper | |
| 8 | +public interface LymsYyscArchiveMapper extends BaseMapper<LymsYyscArchive> { | |
| 9 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsYyscRecordAnswerMapper.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.mapper; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 4 | +import com.lyms.talkonlineweb.domain.LymsYyscRecordAnswer; | |
| 5 | +import org.apache.ibatis.annotations.Mapper; | |
| 6 | + | |
| 7 | +@Mapper | |
| 8 | +public interface LymsYyscRecordAnswerMapper extends BaseMapper<LymsYyscRecordAnswer> { | |
| 9 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsYyscRecordMapper.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.mapper; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 4 | + | |
| 5 | +import com.lyms.talkonlineweb.domain.LymsYyscRecord; | |
| 6 | + | |
| 7 | +import org.apache.ibatis.annotations.Mapper; | |
| 8 | + | |
| 9 | + | |
| 10 | +@Mapper | |
| 11 | +public interface LymsYyscRecordMapper extends BaseMapper<LymsYyscRecord> { | |
| 12 | + | |
| 13 | + | |
| 14 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/request/XljcAnswerVO.java
View file @
441c8fe
| 1 | 1 | package com.lyms.talkonlineweb.request; |
| 2 | 2 | |
| 3 | +import com.lyms.talkonlineweb.domain.BaseRecordAnswer; | |
| 3 | 4 | import com.lyms.talkonlineweb.domain.LymsXljcRecordAnswer; |
| 4 | 5 | import lombok.Data; |
| 5 | 6 | |
| ... | ... | @@ -12,6 +13,6 @@ |
| 12 | 13 | |
| 13 | 14 | private String typeLabel; |
| 14 | 15 | |
| 15 | - List<LymsXljcRecordAnswer> recordAnswers = new ArrayList<>(); | |
| 16 | + List<BaseRecordAnswer> recordAnswers = new ArrayList<>(); | |
| 16 | 17 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/request/YyscExamineRequest.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.request; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | +import lombok.ToString; | |
| 5 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 6 | + | |
| 7 | +import java.io.Serializable; | |
| 8 | +import java.util.ArrayList; | |
| 9 | +import java.util.Date; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + *营养筛查结果提交入参 | |
| 14 | + */ | |
| 15 | +@Data | |
| 16 | +@ToString | |
| 17 | +public class YyscExamineRequest implements Serializable { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 档案ID | |
| 21 | + */ | |
| 22 | + private Integer archId; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 量表编码 | |
| 26 | + */ | |
| 27 | + private String formCode; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 量表版本 | |
| 31 | + */ | |
| 32 | + private String formVersion; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 检测时间 | |
| 36 | + */ | |
| 37 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 38 | + private Date examineTime; | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * 检测医生ID | |
| 42 | + */ | |
| 43 | + private Integer examineDoctor; | |
| 44 | + | |
| 45 | + | |
| 46 | + List<XljcAnswerVO> answers = new ArrayList<>(); | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 总分数 | |
| 50 | + */ | |
| 51 | + private Integer sumScore; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 因子分数 | |
| 55 | + */ | |
| 56 | + private String factorScore; | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 处理措施 | |
| 60 | + */ | |
| 61 | + private String dealMeasure; | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 营养风险类型代码 二级筛查才有 | |
| 65 | + */ | |
| 66 | + private String riskType; | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 营养风险类名称 类型为其他时填写 | |
| 70 | + */ | |
| 71 | + private String riskName; | |
| 72 | + | |
| 73 | + | |
| 74 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsYyscArchiveService.java
View file @
441c8fe
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsYyscRecordAnswerService.java
View file @
441c8fe
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsYyscRecordService.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.service; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
| 4 | +import com.lyms.talkonlineweb.domain.LymsUser; | |
| 5 | +import com.lyms.talkonlineweb.domain.LymsYyscRecord; | |
| 6 | +import com.lyms.talkonlineweb.request.XljcExamineRequest; | |
| 7 | +import com.lyms.talkonlineweb.request.YyscExamineRequest; | |
| 8 | + | |
| 9 | + | |
| 10 | +public interface LymsYyscRecordService extends IService<LymsYyscRecord> { | |
| 11 | + | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 保存检测记录 3张表数据 | |
| 15 | + * @param yyscExamineRequest | |
| 16 | + * @param curUser | |
| 17 | + * @return | |
| 18 | + */ | |
| 19 | + boolean saveRecord(YyscExamineRequest yyscExamineRequest, LymsUser curUser); | |
| 20 | + | |
| 21 | + public YyscExamineRequest queryRecordById(Integer rid) ; | |
| 22 | + | |
| 23 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java
View file @
441c8fe
| ... | ... | @@ -76,7 +76,7 @@ |
| 76 | 76 | if (CollectionUtils.isNotEmpty(dictList)) { |
| 77 | 77 | Diagnose diagnose = new Diagnose(); |
| 78 | 78 | diagnose.setDiagnoseCode(dictList.get(0).getCode()); |
| 79 | - diagnose.setDiagnoseName(diagnoseName); | |
| 79 | + diagnose.setDiagnoseName(dictList.get(0).getValue()); | |
| 80 | 80 | return diagnose; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| ... | ... | @@ -148,7 +148,18 @@ |
| 148 | 148 | |
| 149 | 149 | //疾病 |
| 150 | 150 | List<String> diagnoses = Arrays.asList(lymsHisInfo.getDiagnose().split(",")); |
| 151 | + Map<String,Diagnose> diagnoseMap = new HashMap<>(); | |
| 151 | 152 | List<String> diagnoseIds = new ArrayList<>();//疾病ids |
| 153 | + for(String diagnoseName: diagnoses){ | |
| 154 | + Diagnose diagnose = this.getDiagnoseByName(diagnoseName); | |
| 155 | + if(diagnose == null){ | |
| 156 | + return "疾病["+diagnoseName+"]不存在,请在设置-字典管理中添加疾病或在疾病映射中添加映射关系。"; | |
| 157 | + } | |
| 158 | + diagnoseIds.add(diagnose.getDiagnoseCode().toString()); | |
| 159 | + diagnoseMap.put(diagnoseName,diagnose); | |
| 160 | + } | |
| 161 | + | |
| 162 | + /* | |
| 152 | 163 | List<String> diagnoseOrmIds = new ArrayList<>();//疾病映射ids |
| 153 | 164 | if (null != diagnoses) { |
| 154 | 165 | for (String diagnose : diagnoses) { |
| ... | ... | @@ -181,7 +192,7 @@ |
| 181 | 192 | }else { |
| 182 | 193 | return "疾病不存在,请在设置-字典管理中添加疾病或在疾病映射中添加映射关系。"; |
| 183 | 194 | } |
| 184 | - } | |
| 195 | + }*/ | |
| 185 | 196 | //患者(身份证) |
| 186 | 197 | String idCard = lymsHisInfo.getIdcard(); |
| 187 | 198 | if (StringUtil.isEmpty(idCard)) { |
| ... | ... | @@ -231,8 +242,8 @@ |
| 231 | 242 | pcase.setDtname(doctorName); |
| 232 | 243 | pcase.setCreatedby(1); |
| 233 | 244 | pcase.setCreated(lymsHisInfo.getCreated()); |
| 234 | - String illness = StringUtils.join(Arrays.asList(diagnoseIds.toArray()), ",");//疾病ids | |
| 235 | - BaseResponse baseResponse = saveOrUpdatePatient(patient2, pcase, illness); | |
| 245 | + //String illness = StringUtils.join(Arrays.asList(diagnoseIds.toArray()), ",");//疾病ids | |
| 246 | + BaseResponse baseResponse = saveOrUpdatePatient(patient2, pcase, diagnoseMap); | |
| 236 | 247 | if (null != baseResponse && 0 == baseResponse.getErrorcode()) { |
| 237 | 248 | log.info(">>>>>>>>>>>>>>>患者添加成功!"); |
| 238 | 249 | }else { |
| ... | ... | @@ -243,7 +254,7 @@ |
| 243 | 254 | } |
| 244 | 255 | |
| 245 | 256 | //添加修改患者方法 |
| 246 | - public BaseResponse saveOrUpdatePatient(LymsPatient patient, LymsPcase pcase, String illness) { | |
| 257 | + public BaseResponse saveOrUpdatePatient(LymsPatient patient, LymsPcase pcase, Map<String,Diagnose> diagnoseMap) { | |
| 247 | 258 | BaseResponse baseResponse = new BaseResponse(); |
| 248 | 259 | log.info(">>>>>>>>>>>>>>>登记病例"); |
| 249 | 260 | baseResponse.setErrormsg(""); |
| 250 | 261 | |
| 251 | 262 | |
| 252 | 263 | |
| 253 | 264 | |
| 254 | 265 | |
| 255 | 266 | |
| ... | ... | @@ -273,37 +284,34 @@ |
| 273 | 284 | pcase.setPid(patient.getId()); |
| 274 | 285 | pcase.setCreatedtime(new Date()); |
| 275 | 286 | f = lymsPcaseService.saveOrUpdate(pcase); |
| 276 | - String[] iArr = illness.split(","); | |
| 277 | 287 | |
| 288 | + | |
| 278 | 289 | log.info(patient); |
| 279 | 290 | log.info(pcase); |
| 280 | 291 | |
| 281 | 292 | Map param = new HashMap(); |
| 282 | 293 | param.put("vtype",3); |
| 283 | 294 | List<LymsDict> dLst=lymsDictService.listByMap(param); |
| 284 | - for (int i = 0; i < iArr.length; i++) { | |
| 295 | + diagnoseMap.keySet().forEach(key->{ | |
| 296 | + Diagnose diagnose = diagnoseMap.get(key); | |
| 285 | 297 | LymsIllness ness = new LymsIllness(); |
| 286 | 298 | ness.setCreatedby(patient.getCreatedby()); |
| 287 | 299 | ness.setPcid(pcase.getPcid()); |
| 288 | - ness.setIid(Integer.parseInt(iArr[i])); | |
| 300 | + ness.setIid(diagnose.getDiagnoseCode()); | |
| 301 | + ness.setIname(key); | |
| 289 | 302 | ness.setCreatedtime(new Date()); |
| 290 | 303 | |
| 291 | - dLst.forEach(e->{ | |
| 292 | - if(e.getCode().intValue()==ness.getIid().intValue()){ | |
| 293 | - ness.setIname(e.getValue()); | |
| 294 | - } | |
| 295 | - }); | |
| 296 | 304 | |
| 297 | 305 | param.clear(); |
| 298 | 306 | param.put("pcid", pcase.getPcid()); |
| 299 | - param.put("iid", iArr[i]); | |
| 307 | + param.put("iid", diagnose.getDiagnoseCode()); | |
| 300 | 308 | List<LymsIllness> iLst = lymsIllnessService.listByMap(param); |
| 301 | 309 | if (iLst.size() > 0) { |
| 302 | 310 | ness.setId(iLst.get(0).getId()); |
| 303 | 311 | } |
| 304 | - f = lymsIllnessService.saveOrUpdate(ness); | |
| 305 | - log.info(ness.toString()); | |
| 306 | - } | |
| 312 | + lymsIllnessService.saveOrUpdate(ness); | |
| 313 | + }); | |
| 314 | + | |
| 307 | 315 | |
| 308 | 316 | Date instDate = new Date(); |
| 309 | 317 | //需要添问诊卡记录 |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsXljcRecordServiceImpl.java
View file @
441c8fe
| ... | ... | @@ -91,15 +91,16 @@ |
| 91 | 91 | List<XljcAnswerVO> answers = xljcExamineRequest.getAnswers(); |
| 92 | 92 | List<LymsXljcRecordAnswer> recordAnswerList = new ArrayList<>(); |
| 93 | 93 | for(XljcAnswerVO answer: answers){ |
| 94 | - List<LymsXljcRecordAnswer> recordAnswers = answer.getRecordAnswers(); | |
| 95 | - for(LymsXljcRecordAnswer recordAnswer: recordAnswers){ | |
| 96 | - recordAnswer.setRid(record.getId()); | |
| 97 | - recordAnswer.setTypeLabel(answer.getTypeLabel()); | |
| 98 | - recordAnswer.setCreatedby(curUser.getUid()); | |
| 99 | - recordAnswer.setCreatedtime(currentDate); | |
| 94 | + List<BaseRecordAnswer> baseRecordAnswers = answer.getRecordAnswers(); | |
| 95 | + for(BaseRecordAnswer recordAnswer: baseRecordAnswers){ | |
| 96 | + LymsXljcRecordAnswer lymsXljcRecordAnswer = new LymsXljcRecordAnswer(); | |
| 97 | + BeanUtils.copyProperties(recordAnswer,lymsXljcRecordAnswer); | |
| 98 | + lymsXljcRecordAnswer.setRid(record.getId()); | |
| 99 | + lymsXljcRecordAnswer.setTypeLabel(answer.getTypeLabel()); | |
| 100 | + lymsXljcRecordAnswer.setCreatedby(curUser.getUid()); | |
| 101 | + lymsXljcRecordAnswer.setCreatedtime(currentDate); | |
| 102 | + recordAnswerList.add(lymsXljcRecordAnswer); | |
| 100 | 103 | } |
| 101 | - recordAnswerList.addAll(recordAnswers); | |
| 102 | - | |
| 103 | 104 | } |
| 104 | 105 | lymsXljcRecordAnswerService.saveBatch(recordAnswerList); |
| 105 | 106 | |
| 106 | 107 | |
| ... | ... | @@ -165,10 +166,11 @@ |
| 165 | 166 | query.eq("rid",rid); |
| 166 | 167 | List<LymsXljcRecordAnswer> recordAnswers = lymsXljcRecordAnswerService.list(query); |
| 167 | 168 | |
| 168 | - Map<String,List<LymsXljcRecordAnswer>> map = new HashMap<>(); | |
| 169 | + Map<String,List<BaseRecordAnswer>> map = new HashMap<>(); | |
| 169 | 170 | |
| 170 | 171 | for(LymsXljcRecordAnswer answer: recordAnswers){ |
| 171 | - LymsXljcRecordAnswer recordAnswer = new LymsXljcRecordAnswer(); | |
| 172 | + | |
| 173 | + BaseRecordAnswer recordAnswer = new BaseRecordAnswer(); | |
| 172 | 174 | recordAnswer.setQuestionId(answer.getQuestionId()); |
| 173 | 175 | recordAnswer.setQuestionAnswer(answer.getQuestionAnswer()); |
| 174 | 176 | recordAnswer.setQuestionLabel(answer.getQuestionLabel()); |
| ... | ... | @@ -176,7 +178,7 @@ |
| 176 | 178 | if(map.containsKey(answer.getTypeLabel())){ |
| 177 | 179 | map.get(answer.getTypeLabel()).add(recordAnswer); |
| 178 | 180 | }else{ |
| 179 | - List<LymsXljcRecordAnswer> list = new ArrayList<>(); | |
| 181 | + List<BaseRecordAnswer> list = new ArrayList<>(); | |
| 180 | 182 | list.add(recordAnswer); |
| 181 | 183 | map.put(answer.getTypeLabel(),list); |
| 182 | 184 | } |
| ... | ... | @@ -293,7 +295,8 @@ |
| 293 | 295 | LymsIllness ness = new LymsIllness(); |
| 294 | 296 | ness.setPcid(pcase.getPcid()); |
| 295 | 297 | ness.setIid(diagnose.getDiagnoseCode()); |
| 296 | - ness.setIname(diagnose.getDiagnoseName()); | |
| 298 | + //保存原疾病名称 | |
| 299 | + ness.setIname(recordResult.getDiagnosis()); | |
| 297 | 300 | ness.setCreatedby(currentUser.getCreatedby()); |
| 298 | 301 | ness.setCreatedtime(currentDate); |
| 299 | 302 | boolean save = lymsIllnessService.save(ness); |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsYyscArchiveServiceImpl.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.service.impl; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 4 | +import com.lyms.talkonlineweb.domain.LymsYyscArchive; | |
| 5 | +import com.lyms.talkonlineweb.mapper.LymsYyscArchiveMapper; | |
| 6 | +import com.lyms.talkonlineweb.service.LymsYyscArchiveService; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service | |
| 10 | +public class LymsYyscArchiveServiceImpl extends ServiceImpl<LymsYyscArchiveMapper, LymsYyscArchive> | |
| 11 | + implements LymsYyscArchiveService { | |
| 12 | + | |
| 13 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsYyscRecordAnswerServiceImpl.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.service.impl; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 5 | +import com.lyms.talkonlineweb.domain.LymsYyscRecordAnswer; | |
| 6 | +import com.lyms.talkonlineweb.mapper.LymsYyscRecordAnswerMapper; | |
| 7 | +import com.lyms.talkonlineweb.service.LymsYyscRecordAnswerService; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | + | |
| 10 | +@Service | |
| 11 | +public class LymsYyscRecordAnswerServiceImpl extends ServiceImpl<LymsYyscRecordAnswerMapper, LymsYyscRecordAnswer> | |
| 12 | + implements LymsYyscRecordAnswerService { | |
| 13 | + | |
| 14 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsYyscRecordServiceImpl.java
View file @
441c8fe
| 1 | +package com.lyms.talkonlineweb.service.impl; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 4 | + | |
| 5 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 6 | +import com.lyms.talkonlineweb.domain.*; | |
| 7 | +import com.lyms.talkonlineweb.mapper.LymsYyscRecordMapper; | |
| 8 | +import com.lyms.talkonlineweb.request.XljcAnswerVO; | |
| 9 | +import com.lyms.talkonlineweb.request.XljcExamineRequest; | |
| 10 | + | |
| 11 | +import com.lyms.talkonlineweb.request.YyscExamineRequest; | |
| 12 | +import com.lyms.talkonlineweb.service.*; | |
| 13 | +import lombok.extern.log4j.Log4j2; | |
| 14 | +import org.springframework.beans.BeanUtils; | |
| 15 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 16 | +import org.springframework.stereotype.Service; | |
| 17 | +import org.springframework.transaction.annotation.Transactional; | |
| 18 | + | |
| 19 | +import java.util.*; | |
| 20 | + | |
| 21 | +@Log4j2 | |
| 22 | +@Service | |
| 23 | +public class LymsYyscRecordServiceImpl extends ServiceImpl<LymsYyscRecordMapper, LymsYyscRecord> | |
| 24 | + implements LymsYyscRecordService { | |
| 25 | + | |
| 26 | + @Autowired | |
| 27 | + private LymsDoctorService lymsDoctorService; | |
| 28 | + | |
| 29 | + @Autowired | |
| 30 | + private LymsYyscRecordAnswerService lymsYyscRecordAnswerService; | |
| 31 | + | |
| 32 | + @Autowired | |
| 33 | + private LymsXljcRecordTraceService lymsXljcRecordTraceService; | |
| 34 | + | |
| 35 | + @Autowired | |
| 36 | + private LymsHisInfoService lymsHisInfoService; | |
| 37 | + | |
| 38 | + @Autowired | |
| 39 | + private LymsXljcArchiveService lymsXljcArchiveService; | |
| 40 | + | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + @Transactional | |
| 44 | + public boolean saveRecord(YyscExamineRequest yyscExamineRequest, LymsUser curUser) { | |
| 45 | + | |
| 46 | + Date currentDate = new Date(); | |
| 47 | + LymsYyscRecord record = new LymsYyscRecord(); | |
| 48 | + BeanUtils.copyProperties(yyscExamineRequest,record); | |
| 49 | + LymsDoctor examineDoctor = lymsDoctorService.getById(record.getExamineDoctor()); | |
| 50 | + record.setExamineHid(examineDoctor.getHid()); | |
| 51 | + record.setExamineDpid(examineDoctor.getDpid()); | |
| 52 | + record.setUploadStatus(0); | |
| 53 | + record.setPrintStatus(0); | |
| 54 | + record.setCreatedby(curUser.getUid()); | |
| 55 | + record.setCreatedtime(currentDate); | |
| 56 | + boolean flag = save(record); | |
| 57 | + | |
| 58 | + if(flag){ | |
| 59 | + List<XljcAnswerVO> answers = yyscExamineRequest.getAnswers(); | |
| 60 | + List<LymsYyscRecordAnswer> yyscRecordAnswers = new ArrayList<>(); | |
| 61 | + for(XljcAnswerVO answer: answers){ | |
| 62 | + List<BaseRecordAnswer> recordAnswers = answer.getRecordAnswers(); | |
| 63 | + for(BaseRecordAnswer recordAnswer: recordAnswers){ | |
| 64 | + LymsYyscRecordAnswer yyscRecordAnswer = new LymsYyscRecordAnswer(); | |
| 65 | + BeanUtils.copyProperties(recordAnswer,yyscRecordAnswer); | |
| 66 | + yyscRecordAnswer.setRid(record.getId()); | |
| 67 | + yyscRecordAnswer.setTypeLabel(answer.getTypeLabel()); | |
| 68 | + yyscRecordAnswer.setCreatedby(curUser.getUid()); | |
| 69 | + yyscRecordAnswer.setCreatedtime(currentDate); | |
| 70 | + yyscRecordAnswers.add(yyscRecordAnswer); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + lymsYyscRecordAnswerService.saveBatch(yyscRecordAnswers); | |
| 74 | + | |
| 75 | + }else{ | |
| 76 | + log.error("保存营养筛查结果失败,{}",yyscExamineRequest); | |
| 77 | + throw new RuntimeException("保存营养筛查结果失败"); | |
| 78 | + } | |
| 79 | + return true; | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Override | |
| 83 | + public YyscExamineRequest queryRecordById(Integer rid) { | |
| 84 | + LymsYyscRecord record = getById(rid); | |
| 85 | + QueryWrapper<LymsYyscRecordAnswer> query = new QueryWrapper(); | |
| 86 | + query.eq("rid",rid); | |
| 87 | + List<LymsYyscRecordAnswer> recordAnswers = lymsYyscRecordAnswerService.list(query); | |
| 88 | + | |
| 89 | + Map<String,List<BaseRecordAnswer>> map = new HashMap<>(); | |
| 90 | + for(LymsYyscRecordAnswer answer: recordAnswers){ | |
| 91 | + | |
| 92 | + BaseRecordAnswer recordAnswer = new BaseRecordAnswer(); | |
| 93 | + recordAnswer.setQuestionId(answer.getQuestionId()); | |
| 94 | + recordAnswer.setQuestionAnswer(answer.getQuestionAnswer()); | |
| 95 | + recordAnswer.setQuestionLabel(answer.getQuestionLabel()); | |
| 96 | + | |
| 97 | + if(map.containsKey(answer.getTypeLabel())){ | |
| 98 | + map.get(answer.getTypeLabel()).add(recordAnswer); | |
| 99 | + }else{ | |
| 100 | + List<BaseRecordAnswer> list = new ArrayList<>(); | |
| 101 | + list.add(recordAnswer); | |
| 102 | + map.put(answer.getTypeLabel(),list); | |
| 103 | + } | |
| 104 | + } | |
| 105 | + | |
| 106 | + YyscExamineRequest request = new YyscExamineRequest(); | |
| 107 | + BeanUtils.copyProperties(record,request); | |
| 108 | + | |
| 109 | + List<XljcAnswerVO> xljcAnswerVOS = new ArrayList<>(); | |
| 110 | + map.forEach((key,value)->{ | |
| 111 | + XljcAnswerVO vo = new XljcAnswerVO(); | |
| 112 | + vo.setTypeLabel(key); | |
| 113 | + vo.setRecordAnswers(value); | |
| 114 | + xljcAnswerVOS.add(vo); | |
| 115 | + }); | |
| 116 | + request.setAnswers(xljcAnswerVOS); | |
| 117 | + return request; | |
| 118 | + } | |
| 119 | + | |
| 120 | +} |
talkonlineweb/src/main/resources/mapper/LymsXljcRecordAnswerMapper.xml
View file @
441c8fe
| ... | ... | @@ -7,8 +7,10 @@ |
| 7 | 7 | <resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.LymsXljcRecordAnswer"> |
| 8 | 8 | <id property="id" column="id" jdbcType="INTEGER"/> |
| 9 | 9 | <result property="rid" column="rid" jdbcType="INTEGER"/> |
| 10 | - <result property="questionId" column="question_id" jdbcType="INTEGER"/> | |
| 10 | + <result property="typeLabel" column="type_label" jdbcType="VARCHAR"/> | |
| 11 | + <result property="questionId" column="question_id" jdbcType="VARCHAR"/> | |
| 11 | 12 | <result property="questionAnswer" column="question_answer" jdbcType="VARCHAR"/> |
| 13 | + <result property="questionLabel" column="question_label" jdbcType="VARCHAR"/> | |
| 12 | 14 | <result property="createdby" column="createdby" jdbcType="INTEGER"/> |
| 13 | 15 | <result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/> |
| 14 | 16 | </resultMap> |
talkonlineweb/src/main/resources/mapper/LymsYyscArchiveMapper.xml
View file @
441c8fe
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.lyms.talkonlineweb.mapper.LymsYyscArchiveMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.LymsYyscArchive"> | |
| 8 | + <id property="id" column="id" jdbcType="INTEGER"/> | |
| 9 | + <result property="pname" column="pname" jdbcType="VARCHAR"/> | |
| 10 | + <result property="idno" column="idno" jdbcType="VARCHAR"/> | |
| 11 | + <result property="birth" column="birth" jdbcType="VARCHAR"/> | |
| 12 | + <result property="age" column="age" jdbcType="INTEGER"/> | |
| 13 | + <result property="sex" column="sex" jdbcType="INTEGER"/> | |
| 14 | + <result property="tel" column="tel" jdbcType="VARCHAR"/> | |
| 15 | + <result property="bookbuilDoctor" column="bookbuil_doctor" jdbcType="INTEGER"/> | |
| 16 | + <result property="bookbuilDoctorName" column="bookbuil_doctor_name" jdbcType="VARCHAR"/> | |
| 17 | + <result property="hid" column="hid" jdbcType="INTEGER"/> | |
| 18 | + <result property="dpid" column="dpid" jdbcType="INTEGER"/> | |
| 19 | + <result property="height" column="height" jdbcType="INTEGER"/> | |
| 20 | + <result property="weight" column="weight" jdbcType="DECIMAL"/> | |
| 21 | + <result property="bookbuilDate" column="bookbuil_date" jdbcType="TIMESTAMP"/> | |
| 22 | + <result property="createdby" column="createdby" jdbcType="INTEGER"/> | |
| 23 | + <result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/> | |
| 24 | + <result property="updatedby" column="updatedby" jdbcType="VARCHAR"/> | |
| 25 | + <result property="updatedtime" column="updatedtime" jdbcType="TIMESTAMP"/> | |
| 26 | + </resultMap> | |
| 27 | + | |
| 28 | + | |
| 29 | +</mapper> |
talkonlineweb/src/main/resources/mapper/LymsYyscRecordAnswerMapper.xml
View file @
441c8fe
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.lyms.talkonlineweb.mapper.LymsYyscRecordAnswerMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.LymsYyscRecordAnswer"> | |
| 8 | + <id property="id" column="id" jdbcType="INTEGER"/> | |
| 9 | + <result property="rid" column="rid" jdbcType="INTEGER"/> | |
| 10 | + <result property="typeLabel" column="type_label" jdbcType="VARCHAR"/> | |
| 11 | + <result property="questionId" column="question_id" jdbcType="VARCHAR"/> | |
| 12 | + <result property="questionAnswer" column="question_answer" jdbcType="VARCHAR"/> | |
| 13 | + <result property="questionLabel" column="question_label" jdbcType="VARCHAR"/> | |
| 14 | + <result property="createdby" column="createdby" jdbcType="INTEGER"/> | |
| 15 | + <result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/> | |
| 16 | + </resultMap> | |
| 17 | + | |
| 18 | + | |
| 19 | +</mapper> |
talkonlineweb/src/main/resources/mapper/LymsYyscRecordMapper.xml
View file @
441c8fe
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.lyms.talkonlineweb.mapper.LymsYyscRecordMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.LymsYyscRecord"> | |
| 8 | + <id property="id" column="id" jdbcType="INTEGER"/> | |
| 9 | + <result property="archId" column="arch_id" jdbcType="INTEGER"/> | |
| 10 | + <result property="formCode" column="form_code" jdbcType="VARCHAR"/> | |
| 11 | + <result property="formVersion" column="form_version" jdbcType="VARCHAR"/> | |
| 12 | + <result property="examineTime" column="examine_time" jdbcType="TIMESTAMP"/> | |
| 13 | + <result property="examineDoctor" column="examine_doctor" jdbcType="INTEGER"/> | |
| 14 | + <result property="examineHid" column="examine_hid" jdbcType="INTEGER"/> | |
| 15 | + <result property="examineDpid" column="examine_dpid" jdbcType="INTEGER"/> | |
| 16 | + <result property="sumScore" column="sum_score" jdbcType="INTEGER"/> | |
| 17 | + <result property="factorScore" column="factor_score" jdbcType="VARCHAR"/> | |
| 18 | + <result property="dealMeasure" column="deal_measure" jdbcType="VARCHAR"/> | |
| 19 | + | |
| 20 | + <result property="uploadStatus" column="upload_status" jdbcType="INTEGER"/> | |
| 21 | + <result property="uploadTime" column="upload_time" jdbcType="TIMESTAMP"/> | |
| 22 | + <result property="printStatus" column="print_status" jdbcType="INTEGER"/> | |
| 23 | + <result property="printTime" column="print_time" jdbcType="TIMESTAMP"/> | |
| 24 | + <result property="printDoctor" column="print_doctor" jdbcType="INTEGER"/> | |
| 25 | + | |
| 26 | + <result property="createdby" column="createdby" jdbcType="INTEGER"/> | |
| 27 | + <result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/> | |
| 28 | + <result property="updatedby" column="updatedby" jdbcType="INTEGER"/> | |
| 29 | + <result property="updatedtime" column="updatedtime" jdbcType="TIMESTAMP"/> | |
| 30 | + </resultMap> | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | +</mapper> |