提交 fb4a91aa authored 作者: luzhangjian's avatar luzhangjian

feat:病例相关接口

上级 30fe4858
......@@ -8,8 +8,8 @@ import javax.validation.constraints.NotBlank;
@Data
public class InvalidMedicalRecordDTO {
@NotBlank(message = "病历ID不能为空")
@ApiModelProperty("病历ID")
private String id;
@NotBlank(message = "就诊id不能为空")
@ApiModelProperty("就诊id")
private String admId;
}
......@@ -32,6 +32,9 @@ public class ImInfoDetailDocResVo {
@ApiModelProperty("就诊id")
private String admId;
@ApiModelProperty("就诊日期")
private Date admTime;
@ApiModelProperty("订单状态 2.进行中 3.已完成")
private Integer status;
......
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author odd$
* @description: $
* @param: $
* @return: $
* @date: $ $
*/
@Data
public class MedicalSortVo {
@ApiModelProperty("病例记录name")
private String titleContent;
@ApiModelProperty("病例记录值")
private Object value;
@ApiModelProperty("展示顺序")
private Integer sort;
@ApiModelProperty("模块类型")
private Integer inputType;
@ApiModelProperty("是否展示在病历卡片")
private Integer isCard;
@ApiModelProperty("展示信息类型")
private Integer titleType;
@ApiModelProperty("是否为空")
private Integer isNull;
@ApiModelProperty("数据key信息")
private String keywords;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* @program: byh_online_outpatient
* @description:
* @author: zhaosiyi
* @create: 2020-11-03 10:32
**/
@Data
@ToString
public class TreatmentCard {
@ApiModelProperty("复诊病例Id")
private String medicalRecordId;
@ApiModelProperty("展示在卡片上的数据")
List<MedicalSortVo> medicalUserFills ;
}
......@@ -13,10 +13,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
......@@ -48,14 +45,14 @@ public class PatientMedicalRecordController {
return patientMedicalRecordService.updatePatientMedicalRecord(dto);
}
@PostMapping("/invalid")
@ApiOperation(value = "开具处方失效病历", notes = "开具处方失效病历")
public BaseResponse<Objects> invalid(@RequestBody @Validated InvalidMedicalRecordDTO dto,
@PostMapping("/insertOrUpdate")
@ApiOperation(value = "新建或修改复诊病历", notes = "新建或修改复诊病历")
public BaseResponse<InsertPatientMedicalRecordVO> insertOrUpdate(@RequestBody @Validated InsertPatientMedicalRecordDTO dto,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return BaseResponse.error(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
return patientMedicalRecordService.invalidMedicalRecord(dto);
return patientMedicalRecordService.insertOrUpdate(dto);
}
@PostMapping("/detail")
......@@ -68,4 +65,18 @@ public class PatientMedicalRecordController {
return patientMedicalRecordService.detailMedicalRecord(dto);
}
@ApiOperation(value = "推送病例卡片", notes = "医生开具复诊病例推送小卡片")
@RequestMapping(value = "/treatmentCard", method = RequestMethod.POST)
public BaseResponse<Object> treatmentCard(@RequestBody @Validated InvalidMedicalRecordDTO param,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return BaseResponse.error(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
return patientMedicalRecordService.treatmentCard(param.getAdmId());
}
}
......@@ -11,4 +11,7 @@ public interface PatientMedicalRecordMapper extends BaseMapper<PatientMedicalRec
@Select("select * from patient_medical_record where id = #{id} and record_status = #{status}")
PatientMedicalRecordEntity getByIdAndStatus(String id, int status);
@Select("select * from patient_medical_record where adm_id = #{id} and record_status = 1")
PatientMedicalRecordEntity getByAdmId(String admId);
}
......@@ -19,8 +19,9 @@ public interface PatientMedicalRecordService {
BaseResponse<InsertPatientMedicalRecordVO> updatePatientMedicalRecord(UpdatePatientMedicalRecordDTO dto);
BaseResponse<Objects> invalidMedicalRecord(InvalidMedicalRecordDTO dto);
BaseResponse<PatientMedicalRecordVO> detailMedicalRecord(InvalidMedicalRecordDTO dto);
BaseResponse<InsertPatientMedicalRecordVO> insertOrUpdate(InsertPatientMedicalRecordDTO dto);
BaseResponse<Object> treatmentCard(String admId);
}
package com.ebaiyihui.family.doctor.server.service;
/**
* @program byh-aggregation-payment
* @description:
* @author: chenmet
* @create: 2019/08/21 15:30
*/
public interface RedisTemplateService {
/**
* Description: 根据key获取值
* @param key
* @return: boolean
* @author: zhaosy
* @date: 2019/10/29 2:06 PM
*/
boolean get(String key);
/**
* Description: 根据key来set数据
* @param key
* @return: void
* @author: zhaosy
* @date: 2019/10/29 2:07 PM
*/
void set(String key);
/**
* Description: 根据key删除值
* @param key
* @return: boolean
* @author: zhaosy
* @date: 2019/10/29 2:08 PM
*/
boolean del(String key);
/**
* Description: 根据key获取redis中的时间
* @param key
* @return: Long
* @author: zhaosy
* @date: 2019/10/29 2:08 PM
*/
Long getTime(String key);
/**
* Description: 给redis设置锁,以及锁的过期时间
* @param key
* @param value
* @param time
* @return: boolean
* @author: zhaosy
* @date: 2019/10/29 2:09PM
*/
boolean addLock(String key, String value, long time);
boolean addLockNew(String key, String value, long time);
/**
* Description: 加锁
* @param key
* @param value
* @return: boolean
*/
boolean addLock(String key, String value);
/**
* Description: 判断redis中是否有锁
* @param key
* @return: boolean
* @author: zhaosy
* @date: 2019/10/29 2:11 PM
*/
boolean hasKey(String key);
}
\ No newline at end of file
......@@ -231,6 +231,7 @@ public class PatientSignServiceImpl implements PatientSignService {
resVo.setDeptId(patientSignEntity.getDeptId().toString());
resVo.setDeptName(patientSignEntity.getDeptName());
resVo.setSignEndTime(patientSignEntity.getSignEndTime());
resVo.setAdmTime(patientSignEntity.getSignEndTime());
//患者信息
PatientEntity patientEntity = patientMapper.selectById(patientSignEntity.getPatientId());
......
package com.ebaiyihui.family.doctor.server.service.impl;
import com.ebaiyihui.family.doctor.server.service.RedisTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.concurrent.TimeUnit;
/**
* @program byh-aggregation-payment
* @description:
* @author: chenmet
* @create: 2019/08/21 15:31
*/
@Service
@Slf4j
public class RedisTemplateServiceImpl implements RedisTemplateService {
@Autowired
StringRedisTemplate stringRedisTemplate;
@Override
public boolean get(String key) {
return stringRedisTemplate.hasKey(key);
}
@Override
public void set(String key) {
stringRedisTemplate.opsForValue().set(key, key, 30, TimeUnit.SECONDS);
}
@Override
public boolean del(String key) {
return stringRedisTemplate.delete(key);
}
@Override
public Long getTime(String key) {
return stringRedisTemplate.getExpire(key, TimeUnit.SECONDS);
}
@Override
public boolean addLock(String key, String value, long time) {
return stringRedisTemplate.opsForValue().setIfAbsent(key, value);
}
//有锁:true 没锁:false
@Override
public synchronized boolean addLockNew(String key, String value, long time) {
boolean flag =true;
if(!get(key)){
stringRedisTemplate.opsForValue().set(key,value,time,TimeUnit.SECONDS);
return false;
}
return flag;
}
@Override
public boolean addLock(String key, String value) {
return stringRedisTemplate.opsForValue().setIfAbsent(key, value);
}
@Override
public boolean hasKey(String key) {
return stringRedisTemplate.hasKey(key);
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论