|
@ -10493,86 +10493,88 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//同步处方
|
|
|
String applyDoctor = doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode();
|
|
|
com.alibaba.fastjson.JSONObject object = hcyyPrescriptionService.savePrescriptionToEntrance("0",outpatientDO.getCardNo(),outpatientDO.getRegisterNo(),outpatientDO.getDept(),applyDoctor,"50400",infoDOS);
|
|
|
logger.info("成功上传处方"+object);
|
|
|
//{"msg":"交易成功","code":"0","data":{"PresDetail":{"PresNo":"16151365"}},"success":"True"}
|
|
|
if (object!=null){
|
|
|
if (object.getString("code").equalsIgnoreCase("0")){
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("data");
|
|
|
com.alibaba.fastjson.JSONObject jsonObject1 = jsonObject.getJSONObject("PresDetail");
|
|
|
String realOrder = jsonObject1.getString("PresNo");
|
|
|
wlyyPrescriptionDO.setAdmNo(outpatientDO.getAdmNo());
|
|
|
wlyyPrescriptionDO.setSerialNo(outpatientDO.getAdmNo());
|
|
|
wlyyPrescriptionDO.setRealOrder(realOrder);
|
|
|
}else {
|
|
|
throw new Exception(object.getString("msg"));
|
|
|
if(infoDOS!=null&&infoDOS.size()!=0){
|
|
|
//同步处方
|
|
|
String applyDoctor = doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode();
|
|
|
com.alibaba.fastjson.JSONObject object = hcyyPrescriptionService.savePrescriptionToEntrance("0",outpatientDO.getCardNo(),outpatientDO.getRegisterNo(),outpatientDO.getDept(),applyDoctor,"50400",infoDOS);
|
|
|
logger.info("成功上传处方"+object);
|
|
|
//{"msg":"交易成功","code":"0","data":{"PresDetail":{"PresNo":"16151365"}},"success":"True"}
|
|
|
if (object!=null){
|
|
|
if (object.getString("code").equalsIgnoreCase("0")){
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("data");
|
|
|
com.alibaba.fastjson.JSONObject jsonObject1 = jsonObject.getJSONObject("PresDetail");
|
|
|
String realOrder = jsonObject1.getString("PresNo");
|
|
|
wlyyPrescriptionDO.setAdmNo(outpatientDO.getAdmNo());
|
|
|
wlyyPrescriptionDO.setSerialNo(outpatientDO.getAdmNo());
|
|
|
wlyyPrescriptionDO.setRealOrder(realOrder);
|
|
|
}else {
|
|
|
throw new Exception(object.getString("msg"));
|
|
|
}
|
|
|
}
|
|
|
logger.info("进入处方签名");
|
|
|
hcyyEntranceService.initiateDataSign(wlyyPrescriptionDO.getId(),1,ip);
|
|
|
}
|
|
|
logger.info("进入处方签名");
|
|
|
//电子病例签名
|
|
|
String baseSign=hcyyEntranceService.initiateDataSign(wlyyPrescriptionDO.getId(),2,ip);
|
|
|
//同步电子病历
|
|
|
WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
|
|
|
try {
|
|
|
if (prescriptionEmrDO != null) {
|
|
|
logger.info("电子病历同步");
|
|
|
//电子病例签名
|
|
|
String baseSign=hcyyEntranceService.initiateDataSign(wlyyPrescriptionDO.getId(),2,ip);
|
|
|
hcyyPrescriptionService.saveEmrToEntrance(prescriptionId,baseSign);
|
|
|
logger.info("电子病历同步");
|
|
|
logger.info("电子病历签名");
|
|
|
hcyyEntranceService.initiateDataSign(wlyyPrescriptionDO.getId(),1,ip);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
try {
|
|
|
if (object!=null){
|
|
|
if (object.getString("code").equalsIgnoreCase("0")){
|
|
|
// * @param applyDepaName @param applyDoctorName
|
|
|
WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
|
|
|
String patientCode = outpatientDO.getConsumer();
|
|
|
String realerOrder = prescriptionDO.getRealOrder();
|
|
|
|
|
|
String recipeTime = DateUtil.dateToStr(prescriptionDO.getCreateTime(), "yyyyMMddHHmmss");
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(prescriptionDO.getDoctor());
|
|
|
String applyDepaName = null;
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
applyDepaName = doctorHospitalDOS.get(0).getDeptName();
|
|
|
}
|
|
|
String voucherNo = outpatientDO.getRegisterNo();
|
|
|
String applyDoctorName = prescriptionDO.getDoctorName();
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patientCode);
|
|
|
String userName = null;
|
|
|
String idcard = null;
|
|
|
if (patientDO != null) {
|
|
|
userName = patientDO.getName();
|
|
|
idcard = patientDO.getIdcard();
|
|
|
}
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patientCode);
|
|
|
String userNo = null;
|
|
|
if (patientMappingDO != null) {
|
|
|
userNo = patientMappingDO.getMappingCode();
|
|
|
}
|
|
|
String cardNo = null;
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
|
|
|
cardNo = outpatientDO.getCardNo();
|
|
|
}
|
|
|
logger.info("cardNo:" + cardNo);
|
|
|
/* JSONObject jsonObject =entranceService.BS15054(patientMappingDO.getMappingCode(),prescriptionDO.getRealOrder(),demoFlag);
|
|
|
net.sf.json.JSONObject res = jsonObject.getJSONObject("resquest");
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
String free= 0+"";
|
|
|
if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
}*/
|
|
|
/*ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, "", "","WX_PUB");
|
|
|
*/}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
// try {
|
|
|
// if (object!=null){
|
|
|
// if (object.getString("code").equalsIgnoreCase("0")){
|
|
|
// // * @param applyDepaName @param applyDoctorName
|
|
|
// WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
|
|
|
// String patientCode = outpatientDO.getConsumer();
|
|
|
// String realerOrder = prescriptionDO.getRealOrder();
|
|
|
//
|
|
|
// String recipeTime = DateUtil.dateToStr(prescriptionDO.getCreateTime(), "yyyyMMddHHmmss");
|
|
|
// List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(prescriptionDO.getDoctor());
|
|
|
// String applyDepaName = null;
|
|
|
// if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
// applyDepaName = doctorHospitalDOS.get(0).getDeptName();
|
|
|
// }
|
|
|
// String voucherNo = outpatientDO.getRegisterNo();
|
|
|
// String applyDoctorName = prescriptionDO.getDoctorName();
|
|
|
// BasePatientDO patientDO = basePatientDao.findById(patientCode);
|
|
|
// String userName = null;
|
|
|
// String idcard = null;
|
|
|
// if (patientDO != null) {
|
|
|
// userName = patientDO.getName();
|
|
|
// idcard = patientDO.getIdcard();
|
|
|
// }
|
|
|
// PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patientCode);
|
|
|
// String userNo = null;
|
|
|
// if (patientMappingDO != null) {
|
|
|
// userNo = patientMappingDO.getMappingCode();
|
|
|
// }
|
|
|
// String cardNo = null;
|
|
|
// if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
|
|
|
// cardNo = outpatientDO.getCardNo();
|
|
|
// }
|
|
|
// logger.info("cardNo:" + cardNo);
|
|
|
// /* JSONObject jsonObject =entranceService.BS15054(patientMappingDO.getMappingCode(),prescriptionDO.getRealOrder(),demoFlag);
|
|
|
// net.sf.json.JSONObject res = jsonObject.getJSONObject("resquest");
|
|
|
// logger.info("获取待结算数据 res: " + res.toString());
|
|
|
// String rsCode = res.getString("@RESULT");
|
|
|
// String free= 0+"";
|
|
|
// if ("0".equals(rsCode)) {
|
|
|
// free = res.getString("@total_charge");
|
|
|
// }*/
|
|
|
// /*ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, "", "","WX_PUB");
|
|
|
// */}
|
|
|
// }
|
|
|
// } catch (Exception e) {
|
|
|
// e.printStackTrace();
|
|
|
// }
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|