Browse Source

20210603v1.2

recovery
zy_Java 4 years ago
parent
commit
9e5ac2928b
  1. 10
      recovery/src/main/java/com/ccsens/recovery/api/PatientController.java
  2. 7
      recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java
  3. 4
      recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartRecipe.java
  4. 2
      recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java
  5. 8
      recovery/src/main/java/com/ccsens/recovery/persist/dao/PatientDao.java
  6. 12
      recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java
  7. 13
      recovery/src/main/java/com/ccsens/recovery/service/PatientService.java
  8. 4
      recovery/src/main/java/com/ccsens/recovery/util/Constant.java
  9. 26
      recovery/src/main/resources/mapper_dao/PatientDao.xml

10
recovery/src/main/java/com/ccsens/recovery/api/PatientController.java

@ -51,6 +51,16 @@ public class PatientController {
return JsonResponse.newInstance().ok(patientList);
}
@MustLogin
@ApiOperation(value = "通过身份证号模糊查询患者信息(当前康复中心下)", notes = "zy:")
@RequestMapping(value = "/vague", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PatientVo.Patient> vaguePatientByIdCard(@ApiParam @Validated @RequestBody QueryDto<PatientDto.VaguePatient> params) {
log.info("查看患者的详细信息:{}",params);
List<PatientVo.Patient> patient = patientService.vaguePatientByIdCard(params.getParam(),params.getUserId());
log.info("查看患者的详细信息成功:{}",patient);
return JsonResponse.newInstance().ok(patient);
}
@MustLogin
@ApiOperation(value = "查看患者的详细信息", notes = "zy:")
@RequestMapping(value = "/detail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})

7
recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java

@ -22,6 +22,13 @@ public class PatientDto {
private Long id;
}
@Data
@ApiModel("身份证号模糊查询患者信息")
public static class VaguePatient{
@ApiModelProperty("身份证号")
private String idCard;
}
@Data
@ApiModel("任务详情id")
public static class TaskDetailId{

4
recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartRecipe.java

@ -20,8 +20,8 @@ public class RecoveryWithStartRecipe extends BaseMessageDto{
private Data data;
public RecoveryWithStartRecipe(){
setType(Constant.Message.START_RECOVERY);
setEvent(Constant.Message.START_RECOVERY);
setType(Constant.Message.SWITCHOVER_PROJECT);
setEvent(Constant.Message.SWITCHOVER_PROJECT);
setTime(System.currentTimeMillis());
}

2
recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java

@ -62,7 +62,7 @@ public class RecipeVo {
@ApiModelProperty("康复训练的id")
private Long drillId;
@ApiModelProperty("训练名")
private Long drillName;
private String drillName;
@ApiModelProperty("训练频率")
private String cycle;
@ApiModelProperty("每天几次")

8
recovery/src/main/java/com/ccsens/recovery/persist/dao/PatientDao.java

@ -30,4 +30,12 @@ public interface PatientDao extends PatientMapper {
* @return 机器人信息
*/
RecoveryRobot getRobotByPatientId(@Param("patientId")Long patientId);
/**
* 通过身份证号模糊查询患者信息
* @param idCard 身份证号
* @param centreId 康复中心id
* @return 患者信息
*/
List<PatientVo.Patient> vaguePatientByIdCard(@Param("idCard")String idCard, @Param("centreId")Long centreId);
}

12
recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java

@ -54,7 +54,7 @@ public interface IPatientService {
* @param userId userID
* @return 返回训练记录的id
*/
PatientVo.RecipeRecordId startDrill(PatientDto.StartDrill param, Long userId) throws JsonProcessingException, Exception;
PatientVo.RecipeRecordId startDrill(PatientDto.StartDrill param, Long userId) throws Exception;
/**
* 结束训练
@ -68,7 +68,7 @@ public interface IPatientService {
* @param param 记录id和结果
* @param userId userId
*/
void actionFeedback(PatientDto.ActionFeedback param, Long userId) throws JsonProcessingException, Exception;
void actionFeedback(PatientDto.ActionFeedback param, Long userId) throws Exception;
/**
* 竖屏时通过任务id查看患者信息
@ -84,4 +84,12 @@ public interface IPatientService {
* @param userId userId
*/
void completeRecovery(PatientDto.EndRecovery param, Long userId) throws Exception;
/**
* 通过身份证号模糊查询康复中心的患者信息
* @param param 身份证号
* @param userId 康复医生的userId
* @return 返回患者列表
*/
List<PatientVo.Patient> vaguePatientByIdCard(PatientDto.VaguePatient param, Long userId);
}

13
recovery/src/main/java/com/ccsens/recovery/service/PatientService.java

@ -268,4 +268,17 @@ public class PatientService implements IPatientService{
rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME,
JacksonUtil.beanToJson(inMessage));
}
@Override
public List<PatientVo.Patient> vaguePatientByIdCard(PatientDto.VaguePatient param, Long userId) {
Long centreId = null;
//如果康复中心id为空,通过userId查找康复师,然后查找康复中心的id
RecoveryDoctorExample recoveryDoctorExample = new RecoveryDoctorExample();
recoveryDoctorExample.createCriteria().andUserIdEqualTo(userId);
List<RecoveryDoctor> doctorList = recoveryDoctorMapper.selectByExample(recoveryDoctorExample);
if(CollectionUtil.isNotEmpty(doctorList)){
centreId = doctorList.get(0).getCentreId();
}
return patientDao.vaguePatientByIdCard(param.getIdCard(),centreId);
}
}

4
recovery/src/main/java/com/ccsens/recovery/util/Constant.java

@ -8,8 +8,8 @@ public class Constant {
/**消息*/
public static final class Message {
/**启动康复流程*/
public static final String START_RECOVERY = "startRecovery";
/**切换项目*/
public static final String SWITCHOVER_PROJECT = "switchoverProject";
/**开始训练*/
public static final String START_DRILL = "startDrill";
/**动作反馈*/

26
recovery/src/main/resources/mapper_dao/PatientDao.xml

@ -166,4 +166,30 @@
order by start_time
limit 1
</select>
<select id="vaguePatientByIdCard" resultType="com.ccsens.recovery.bean.vo.PatientVo$Patient">
SELECT
p.id as id,
p.`name` as `name`,
p.sex as sex,
p.age as age,
p.id_card as idCord,
p.phone as phone,
p.address as address,
c.id as recoveryCentreId,
c.`name` as recoveryCentreName,
d.id as doctorId,
d.`name` as doctorName
FROM
t_patient p,
t_doctor d,
t_recovery_centre c
WHERE
p.doctor_id = d.id
and p.centre_id = c.id
and p.rec_status = 0
and d.rec_status = 0
and c.rec_status = 0
and c.id = #{recoveryCentreId}
and p.id_card like concat('%',#{idCard},'%')
</select>
</mapper>
Loading…
Cancel
Save