|
@ -3009,6 +3009,58 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return outpatient;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 指定门诊医生医生
|
|
|
* @param outpatientJson
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public WlyyOutpatientDO saveOutpatientDoctor(String outpatientJson,String registerJson,String chargeType)throws Exception{
|
|
|
|
|
|
//1.保存就诊实体
|
|
|
WlyyOutpatientDO outpatientDO = objectMapper.readValue(outpatientJson,WlyyOutpatientDO.class);
|
|
|
|
|
|
WlyyOutpatientDO one = outpatientDao.findOne(outpatientDO.getId());
|
|
|
if(StringUtils.isNotBlank(one.getDoctor())){
|
|
|
throw new RuntimeException("已有医生接诊");
|
|
|
}
|
|
|
one.setDoctor(outpatientDO.getDoctor());
|
|
|
one.setDoctorName(outpatientDO.getDoctorName());
|
|
|
one.setRegisterDate(outpatientDO.getRegisterDate());
|
|
|
one.setDept(outpatientDO.getDept());
|
|
|
one.setDeptName(outpatientDO.getDeptName());
|
|
|
WlyyOutpatientDO outpatient = outpatientDao.save(one);
|
|
|
|
|
|
WlyyPatientRegisterTimeDO registerTimeDO = null;
|
|
|
|
|
|
try {
|
|
|
//如果是视频预约咨询
|
|
|
if(StringUtils.isNotBlank(registerJson)){
|
|
|
registerTimeDO = objectMapper.readValue(registerJson,WlyyPatientRegisterTimeDO.class);
|
|
|
registerTimeDO.setOutpatientId(outpatient.getId());
|
|
|
registerTimeDO.setCreateTime(new Date());
|
|
|
patientRegisterTimeDao.save(registerTimeDO);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
throw new RuntimeException("号源已经被预约,请选择其他号源");
|
|
|
}
|
|
|
|
|
|
//更新候诊室
|
|
|
List<WlyyHospitalWaitingRoomDO> roomDOs = hospitalWaitingRoomDao.findByOutpatientId(outpatientDO.getId());
|
|
|
|
|
|
if(roomDOs!=null&&roomDOs.size()>0){
|
|
|
for(WlyyHospitalWaitingRoomDO room:roomDOs){
|
|
|
room.setDept(outpatientDO.getDept());
|
|
|
room.setDeptName(outpatientDO.getDeptName());
|
|
|
room.setDoctor(outpatientDO.getDoctor());
|
|
|
room.setDoctorName(outpatientDO.getDoctorName());
|
|
|
room.setChargeType(chargeType);
|
|
|
}
|
|
|
hospitalWaitingRoomDao.save(roomDOs);
|
|
|
}
|
|
|
|
|
|
return outpatient;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 验证电子健康卡授权
|