|
@ -10701,27 +10701,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
}
|
|
|
//患者取消预约
|
|
|
public String cancelNatAppointment (Integer id,String patientId ){
|
|
|
public String cancelNatAppointment (Integer id,String patientId ) throws Exception{
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patientId);
|
|
|
String res = "";
|
|
|
if (patientDO!=null){
|
|
|
String patientCode = null;
|
|
|
try {
|
|
|
patientCode = patientMappingService.findHisPatNoByIdCard(patientDO.getIdcard());
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
|
if (null!=baseNatAppointmentDO){
|
|
|
res = entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(),DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),patientCode,baseNatAppointmentDO.getMobile(),demoFlag);
|
|
|
baseNatAppointmentDO.setIsSuccess("-1");
|
|
|
baseNatAppointmentDO.setCancelReson("患者本人取消");
|
|
|
baseNatAppointmentDO.setCancelTime(new Date());
|
|
|
baseNatAppointmentDO.setCancelBy(patientId);
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
patientCode = patientMappingService.findHisPatNoByIdCard(patientDO.getIdcard());
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
|
if (null!=baseNatAppointmentDO){
|
|
|
res = entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(),DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),patientCode,baseNatAppointmentDO.getMobile(),demoFlag);
|
|
|
if (res.contains("Error")){
|
|
|
throw new Exception(res);
|
|
|
}
|
|
|
baseNatAppointmentDO.setIsSuccess("-1");
|
|
|
baseNatAppointmentDO.setCancelReson("患者本人取消");
|
|
|
baseNatAppointmentDO.setCancelTime(new Date());
|
|
|
baseNatAppointmentDO.setCancelBy(patientId);
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
return res;
|
|
|
}
|